Line data Source code
1 : /* Generated by Cython 3.0.11 */
2 :
3 : #ifndef PY_SSIZE_T_CLEAN
4 : #define PY_SSIZE_T_CLEAN
5 : #endif /* PY_SSIZE_T_CLEAN */
6 : #if defined(CYTHON_LIMITED_API) && 0
7 : #ifndef Py_LIMITED_API
8 : #if CYTHON_LIMITED_API+0 > 0x03030000
9 : #define Py_LIMITED_API CYTHON_LIMITED_API
10 : #else
11 : #define Py_LIMITED_API 0x03030000
12 : #endif
13 : #endif
14 : #endif
15 :
16 : #include "Python.h"
17 : #ifndef Py_PYTHON_H
18 : #error Python headers needed to compile C extensions, please install development version of Python.
19 : #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
20 : #error Cython requires Python 2.7+ or Python 3.3+.
21 : #else
22 : #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API
23 : #define __PYX_EXTRA_ABI_MODULE_NAME "limited"
24 : #else
25 : #define __PYX_EXTRA_ABI_MODULE_NAME ""
26 : #endif
27 : #define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME
28 : #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
29 : #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
30 : #define CYTHON_HEX_VERSION 0x03000BF0
31 : #define CYTHON_FUTURE_DIVISION 1
32 : #include <stddef.h>
33 : #ifndef offsetof
34 : #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
35 : #endif
36 : #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
37 : #ifndef __stdcall
38 : #define __stdcall
39 : #endif
40 : #ifndef __cdecl
41 : #define __cdecl
42 : #endif
43 : #ifndef __fastcall
44 : #define __fastcall
45 : #endif
46 : #endif
47 : #ifndef DL_IMPORT
48 : #define DL_IMPORT(t) t
49 : #endif
50 : #ifndef DL_EXPORT
51 : #define DL_EXPORT(t) t
52 : #endif
53 : #define __PYX_COMMA ,
54 : #ifndef HAVE_LONG_LONG
55 : #define HAVE_LONG_LONG
56 : #endif
57 : #ifndef PY_LONG_LONG
58 : #define PY_LONG_LONG LONG_LONG
59 : #endif
60 : #ifndef Py_HUGE_VAL
61 : #define Py_HUGE_VAL HUGE_VAL
62 : #endif
63 : #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
64 : #if defined(GRAALVM_PYTHON)
65 : /* For very preliminary testing purposes. Most variables are set the same as PyPy.
66 : The existence of this section does not imply that anything works or is even tested */
67 : #define CYTHON_COMPILING_IN_PYPY 0
68 : #define CYTHON_COMPILING_IN_CPYTHON 0
69 : #define CYTHON_COMPILING_IN_LIMITED_API 0
70 : #define CYTHON_COMPILING_IN_GRAAL 1
71 : #define CYTHON_COMPILING_IN_NOGIL 0
72 : #undef CYTHON_USE_TYPE_SLOTS
73 : #define CYTHON_USE_TYPE_SLOTS 0
74 : #undef CYTHON_USE_TYPE_SPECS
75 : #define CYTHON_USE_TYPE_SPECS 0
76 : #undef CYTHON_USE_PYTYPE_LOOKUP
77 : #define CYTHON_USE_PYTYPE_LOOKUP 0
78 : #if PY_VERSION_HEX < 0x03050000
79 : #undef CYTHON_USE_ASYNC_SLOTS
80 : #define CYTHON_USE_ASYNC_SLOTS 0
81 : #elif !defined(CYTHON_USE_ASYNC_SLOTS)
82 : #define CYTHON_USE_ASYNC_SLOTS 1
83 : #endif
84 : #undef CYTHON_USE_PYLIST_INTERNALS
85 : #define CYTHON_USE_PYLIST_INTERNALS 0
86 : #undef CYTHON_USE_UNICODE_INTERNALS
87 : #define CYTHON_USE_UNICODE_INTERNALS 0
88 : #undef CYTHON_USE_UNICODE_WRITER
89 : #define CYTHON_USE_UNICODE_WRITER 0
90 : #undef CYTHON_USE_PYLONG_INTERNALS
91 : #define CYTHON_USE_PYLONG_INTERNALS 0
92 : #undef CYTHON_AVOID_BORROWED_REFS
93 : #define CYTHON_AVOID_BORROWED_REFS 1
94 : #undef CYTHON_ASSUME_SAFE_MACROS
95 : #define CYTHON_ASSUME_SAFE_MACROS 0
96 : #undef CYTHON_UNPACK_METHODS
97 : #define CYTHON_UNPACK_METHODS 0
98 : #undef CYTHON_FAST_THREAD_STATE
99 : #define CYTHON_FAST_THREAD_STATE 0
100 : #undef CYTHON_FAST_GIL
101 : #define CYTHON_FAST_GIL 0
102 : #undef CYTHON_METH_FASTCALL
103 : #define CYTHON_METH_FASTCALL 0
104 : #undef CYTHON_FAST_PYCALL
105 : #define CYTHON_FAST_PYCALL 0
106 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
107 : #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
108 : #endif
109 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
110 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
111 : #undef CYTHON_USE_MODULE_STATE
112 : #define CYTHON_USE_MODULE_STATE 0
113 : #undef CYTHON_USE_TP_FINALIZE
114 : #define CYTHON_USE_TP_FINALIZE 0
115 : #undef CYTHON_USE_DICT_VERSIONS
116 : #define CYTHON_USE_DICT_VERSIONS 0
117 : #undef CYTHON_USE_EXC_INFO_STACK
118 : #define CYTHON_USE_EXC_INFO_STACK 0
119 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
120 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
121 : #endif
122 : #undef CYTHON_USE_FREELISTS
123 : #define CYTHON_USE_FREELISTS 0
124 : #elif defined(PYPY_VERSION)
125 : #define CYTHON_COMPILING_IN_PYPY 1
126 : #define CYTHON_COMPILING_IN_CPYTHON 0
127 : #define CYTHON_COMPILING_IN_LIMITED_API 0
128 : #define CYTHON_COMPILING_IN_GRAAL 0
129 : #define CYTHON_COMPILING_IN_NOGIL 0
130 : #undef CYTHON_USE_TYPE_SLOTS
131 : #define CYTHON_USE_TYPE_SLOTS 0
132 : #ifndef CYTHON_USE_TYPE_SPECS
133 : #define CYTHON_USE_TYPE_SPECS 0
134 : #endif
135 : #undef CYTHON_USE_PYTYPE_LOOKUP
136 : #define CYTHON_USE_PYTYPE_LOOKUP 0
137 : #if PY_VERSION_HEX < 0x03050000
138 : #undef CYTHON_USE_ASYNC_SLOTS
139 : #define CYTHON_USE_ASYNC_SLOTS 0
140 : #elif !defined(CYTHON_USE_ASYNC_SLOTS)
141 : #define CYTHON_USE_ASYNC_SLOTS 1
142 : #endif
143 : #undef CYTHON_USE_PYLIST_INTERNALS
144 : #define CYTHON_USE_PYLIST_INTERNALS 0
145 : #undef CYTHON_USE_UNICODE_INTERNALS
146 : #define CYTHON_USE_UNICODE_INTERNALS 0
147 : #undef CYTHON_USE_UNICODE_WRITER
148 : #define CYTHON_USE_UNICODE_WRITER 0
149 : #undef CYTHON_USE_PYLONG_INTERNALS
150 : #define CYTHON_USE_PYLONG_INTERNALS 0
151 : #undef CYTHON_AVOID_BORROWED_REFS
152 : #define CYTHON_AVOID_BORROWED_REFS 1
153 : #undef CYTHON_ASSUME_SAFE_MACROS
154 : #define CYTHON_ASSUME_SAFE_MACROS 0
155 : #undef CYTHON_UNPACK_METHODS
156 : #define CYTHON_UNPACK_METHODS 0
157 : #undef CYTHON_FAST_THREAD_STATE
158 : #define CYTHON_FAST_THREAD_STATE 0
159 : #undef CYTHON_FAST_GIL
160 : #define CYTHON_FAST_GIL 0
161 : #undef CYTHON_METH_FASTCALL
162 : #define CYTHON_METH_FASTCALL 0
163 : #undef CYTHON_FAST_PYCALL
164 : #define CYTHON_FAST_PYCALL 0
165 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
166 : #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
167 : #endif
168 : #if PY_VERSION_HEX < 0x03090000
169 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
170 : #define CYTHON_PEP489_MULTI_PHASE_INIT 0
171 : #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
172 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
173 : #endif
174 : #undef CYTHON_USE_MODULE_STATE
175 : #define CYTHON_USE_MODULE_STATE 0
176 : #undef CYTHON_USE_TP_FINALIZE
177 : #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
178 : #undef CYTHON_USE_DICT_VERSIONS
179 : #define CYTHON_USE_DICT_VERSIONS 0
180 : #undef CYTHON_USE_EXC_INFO_STACK
181 : #define CYTHON_USE_EXC_INFO_STACK 0
182 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
183 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
184 : #endif
185 : #undef CYTHON_USE_FREELISTS
186 : #define CYTHON_USE_FREELISTS 0
187 : #elif defined(CYTHON_LIMITED_API)
188 : #ifdef Py_LIMITED_API
189 : #undef __PYX_LIMITED_VERSION_HEX
190 : #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
191 : #endif
192 : #define CYTHON_COMPILING_IN_PYPY 0
193 : #define CYTHON_COMPILING_IN_CPYTHON 0
194 : #define CYTHON_COMPILING_IN_LIMITED_API 1
195 : #define CYTHON_COMPILING_IN_GRAAL 0
196 : #define CYTHON_COMPILING_IN_NOGIL 0
197 : #undef CYTHON_CLINE_IN_TRACEBACK
198 : #define CYTHON_CLINE_IN_TRACEBACK 0
199 : #undef CYTHON_USE_TYPE_SLOTS
200 : #define CYTHON_USE_TYPE_SLOTS 0
201 : #undef CYTHON_USE_TYPE_SPECS
202 : #define CYTHON_USE_TYPE_SPECS 1
203 : #undef CYTHON_USE_PYTYPE_LOOKUP
204 : #define CYTHON_USE_PYTYPE_LOOKUP 0
205 : #undef CYTHON_USE_ASYNC_SLOTS
206 : #define CYTHON_USE_ASYNC_SLOTS 0
207 : #undef CYTHON_USE_PYLIST_INTERNALS
208 : #define CYTHON_USE_PYLIST_INTERNALS 0
209 : #undef CYTHON_USE_UNICODE_INTERNALS
210 : #define CYTHON_USE_UNICODE_INTERNALS 0
211 : #ifndef CYTHON_USE_UNICODE_WRITER
212 : #define CYTHON_USE_UNICODE_WRITER 0
213 : #endif
214 : #undef CYTHON_USE_PYLONG_INTERNALS
215 : #define CYTHON_USE_PYLONG_INTERNALS 0
216 : #ifndef CYTHON_AVOID_BORROWED_REFS
217 : #define CYTHON_AVOID_BORROWED_REFS 0
218 : #endif
219 : #undef CYTHON_ASSUME_SAFE_MACROS
220 : #define CYTHON_ASSUME_SAFE_MACROS 0
221 : #undef CYTHON_UNPACK_METHODS
222 : #define CYTHON_UNPACK_METHODS 0
223 : #undef CYTHON_FAST_THREAD_STATE
224 : #define CYTHON_FAST_THREAD_STATE 0
225 : #undef CYTHON_FAST_GIL
226 : #define CYTHON_FAST_GIL 0
227 : #undef CYTHON_METH_FASTCALL
228 : #define CYTHON_METH_FASTCALL 0
229 : #undef CYTHON_FAST_PYCALL
230 : #define CYTHON_FAST_PYCALL 0
231 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
232 : #define CYTHON_PEP487_INIT_SUBCLASS 1
233 : #endif
234 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
235 : #define CYTHON_PEP489_MULTI_PHASE_INIT 0
236 : #undef CYTHON_USE_MODULE_STATE
237 : #define CYTHON_USE_MODULE_STATE 1
238 : #ifndef CYTHON_USE_TP_FINALIZE
239 : #define CYTHON_USE_TP_FINALIZE 0
240 : #endif
241 : #undef CYTHON_USE_DICT_VERSIONS
242 : #define CYTHON_USE_DICT_VERSIONS 0
243 : #undef CYTHON_USE_EXC_INFO_STACK
244 : #define CYTHON_USE_EXC_INFO_STACK 0
245 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
246 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
247 : #endif
248 : #undef CYTHON_USE_FREELISTS
249 : #define CYTHON_USE_FREELISTS 0
250 : #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL)
251 : #define CYTHON_COMPILING_IN_PYPY 0
252 : #define CYTHON_COMPILING_IN_CPYTHON 0
253 : #define CYTHON_COMPILING_IN_LIMITED_API 0
254 : #define CYTHON_COMPILING_IN_GRAAL 0
255 : #define CYTHON_COMPILING_IN_NOGIL 1
256 : #ifndef CYTHON_USE_TYPE_SLOTS
257 : #define CYTHON_USE_TYPE_SLOTS 1
258 : #endif
259 : #ifndef CYTHON_USE_TYPE_SPECS
260 : #define CYTHON_USE_TYPE_SPECS 0
261 : #endif
262 : #undef CYTHON_USE_PYTYPE_LOOKUP
263 : #define CYTHON_USE_PYTYPE_LOOKUP 0
264 : #ifndef CYTHON_USE_ASYNC_SLOTS
265 : #define CYTHON_USE_ASYNC_SLOTS 1
266 : #endif
267 : #ifndef CYTHON_USE_PYLONG_INTERNALS
268 : #define CYTHON_USE_PYLONG_INTERNALS 0
269 : #endif
270 : #undef CYTHON_USE_PYLIST_INTERNALS
271 : #define CYTHON_USE_PYLIST_INTERNALS 0
272 : #ifndef CYTHON_USE_UNICODE_INTERNALS
273 : #define CYTHON_USE_UNICODE_INTERNALS 1
274 : #endif
275 : #undef CYTHON_USE_UNICODE_WRITER
276 : #define CYTHON_USE_UNICODE_WRITER 0
277 : #ifndef CYTHON_AVOID_BORROWED_REFS
278 : #define CYTHON_AVOID_BORROWED_REFS 0
279 : #endif
280 : #ifndef CYTHON_ASSUME_SAFE_MACROS
281 : #define CYTHON_ASSUME_SAFE_MACROS 1
282 : #endif
283 : #ifndef CYTHON_UNPACK_METHODS
284 : #define CYTHON_UNPACK_METHODS 1
285 : #endif
286 : #undef CYTHON_FAST_THREAD_STATE
287 : #define CYTHON_FAST_THREAD_STATE 0
288 : #undef CYTHON_FAST_GIL
289 : #define CYTHON_FAST_GIL 0
290 : #ifndef CYTHON_METH_FASTCALL
291 : #define CYTHON_METH_FASTCALL 1
292 : #endif
293 : #undef CYTHON_FAST_PYCALL
294 : #define CYTHON_FAST_PYCALL 0
295 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
296 : #define CYTHON_PEP487_INIT_SUBCLASS 1
297 : #endif
298 : #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
299 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
300 : #endif
301 : #ifndef CYTHON_USE_MODULE_STATE
302 : #define CYTHON_USE_MODULE_STATE 0
303 : #endif
304 : #ifndef CYTHON_USE_TP_FINALIZE
305 : #define CYTHON_USE_TP_FINALIZE 1
306 : #endif
307 : #undef CYTHON_USE_DICT_VERSIONS
308 : #define CYTHON_USE_DICT_VERSIONS 0
309 : #undef CYTHON_USE_EXC_INFO_STACK
310 : #define CYTHON_USE_EXC_INFO_STACK 0
311 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
312 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
313 : #endif
314 : #ifndef CYTHON_USE_FREELISTS
315 : #define CYTHON_USE_FREELISTS 0
316 : #endif
317 : #else
318 : #define CYTHON_COMPILING_IN_PYPY 0
319 : #define CYTHON_COMPILING_IN_CPYTHON 1
320 : #define CYTHON_COMPILING_IN_LIMITED_API 0
321 : #define CYTHON_COMPILING_IN_GRAAL 0
322 : #define CYTHON_COMPILING_IN_NOGIL 0
323 : #ifndef CYTHON_USE_TYPE_SLOTS
324 : #define CYTHON_USE_TYPE_SLOTS 1
325 : #endif
326 : #ifndef CYTHON_USE_TYPE_SPECS
327 : #define CYTHON_USE_TYPE_SPECS 0
328 : #endif
329 : #ifndef CYTHON_USE_PYTYPE_LOOKUP
330 : #define CYTHON_USE_PYTYPE_LOOKUP 1
331 : #endif
332 : #if PY_MAJOR_VERSION < 3
333 : #undef CYTHON_USE_ASYNC_SLOTS
334 : #define CYTHON_USE_ASYNC_SLOTS 0
335 : #elif !defined(CYTHON_USE_ASYNC_SLOTS)
336 : #define CYTHON_USE_ASYNC_SLOTS 1
337 : #endif
338 : #ifndef CYTHON_USE_PYLONG_INTERNALS
339 : #define CYTHON_USE_PYLONG_INTERNALS 1
340 : #endif
341 : #ifndef CYTHON_USE_PYLIST_INTERNALS
342 : #define CYTHON_USE_PYLIST_INTERNALS 1
343 : #endif
344 : #ifndef CYTHON_USE_UNICODE_INTERNALS
345 : #define CYTHON_USE_UNICODE_INTERNALS 1
346 : #endif
347 : #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
348 : #undef CYTHON_USE_UNICODE_WRITER
349 : #define CYTHON_USE_UNICODE_WRITER 0
350 : #elif !defined(CYTHON_USE_UNICODE_WRITER)
351 : #define CYTHON_USE_UNICODE_WRITER 1
352 : #endif
353 : #ifndef CYTHON_AVOID_BORROWED_REFS
354 : #define CYTHON_AVOID_BORROWED_REFS 0
355 : #endif
356 : #ifndef CYTHON_ASSUME_SAFE_MACROS
357 : #define CYTHON_ASSUME_SAFE_MACROS 1
358 : #endif
359 : #ifndef CYTHON_UNPACK_METHODS
360 : #define CYTHON_UNPACK_METHODS 1
361 : #endif
362 : #ifndef CYTHON_FAST_THREAD_STATE
363 : #define CYTHON_FAST_THREAD_STATE 1
364 : #endif
365 : #ifndef CYTHON_FAST_GIL
366 : #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6)
367 : #endif
368 : #ifndef CYTHON_METH_FASTCALL
369 : #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
370 : #endif
371 : #ifndef CYTHON_FAST_PYCALL
372 : #define CYTHON_FAST_PYCALL 1
373 : #endif
374 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
375 : #define CYTHON_PEP487_INIT_SUBCLASS 1
376 : #endif
377 : #if PY_VERSION_HEX < 0x03050000
378 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
379 : #define CYTHON_PEP489_MULTI_PHASE_INIT 0
380 : #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
381 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
382 : #endif
383 : #ifndef CYTHON_USE_MODULE_STATE
384 : #define CYTHON_USE_MODULE_STATE 0
385 : #endif
386 : #if PY_VERSION_HEX < 0x030400a1
387 : #undef CYTHON_USE_TP_FINALIZE
388 : #define CYTHON_USE_TP_FINALIZE 0
389 : #elif !defined(CYTHON_USE_TP_FINALIZE)
390 : #define CYTHON_USE_TP_FINALIZE 1
391 : #endif
392 : #if PY_VERSION_HEX < 0x030600B1
393 : #undef CYTHON_USE_DICT_VERSIONS
394 : #define CYTHON_USE_DICT_VERSIONS 0
395 : #elif !defined(CYTHON_USE_DICT_VERSIONS)
396 : #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5)
397 : #endif
398 : #if PY_VERSION_HEX < 0x030700A3
399 : #undef CYTHON_USE_EXC_INFO_STACK
400 : #define CYTHON_USE_EXC_INFO_STACK 0
401 : #elif !defined(CYTHON_USE_EXC_INFO_STACK)
402 : #define CYTHON_USE_EXC_INFO_STACK 1
403 : #endif
404 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
405 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
406 : #endif
407 : #ifndef CYTHON_USE_FREELISTS
408 : #define CYTHON_USE_FREELISTS 1
409 : #endif
410 : #endif
411 : #if !defined(CYTHON_FAST_PYCCALL)
412 : #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
413 : #endif
414 : #if !defined(CYTHON_VECTORCALL)
415 : #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
416 : #endif
417 : #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
418 : #if CYTHON_USE_PYLONG_INTERNALS
419 : #if PY_MAJOR_VERSION < 3
420 : #include "longintrepr.h"
421 : #endif
422 : #undef SHIFT
423 : #undef BASE
424 : #undef MASK
425 : #ifdef SIZEOF_VOID_P
426 : enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
427 : #endif
428 : #endif
429 : #ifndef __has_attribute
430 : #define __has_attribute(x) 0
431 : #endif
432 : #ifndef __has_cpp_attribute
433 : #define __has_cpp_attribute(x) 0
434 : #endif
435 : #ifndef CYTHON_RESTRICT
436 : #if defined(__GNUC__)
437 : #define CYTHON_RESTRICT __restrict__
438 : #elif defined(_MSC_VER) && _MSC_VER >= 1400
439 : #define CYTHON_RESTRICT __restrict
440 : #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
441 : #define CYTHON_RESTRICT restrict
442 : #else
443 : #define CYTHON_RESTRICT
444 : #endif
445 : #endif
446 : #ifndef CYTHON_UNUSED
447 : #if defined(__cplusplus)
448 : /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
449 : * but leads to warnings with -pedantic, since it is a C++17 feature */
450 : #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
451 : #if __has_cpp_attribute(maybe_unused)
452 : #define CYTHON_UNUSED [[maybe_unused]]
453 : #endif
454 : #endif
455 : #endif
456 : #endif
457 : #ifndef CYTHON_UNUSED
458 : # if defined(__GNUC__)
459 : # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
460 : # define CYTHON_UNUSED __attribute__ ((__unused__))
461 : # else
462 : # define CYTHON_UNUSED
463 : # endif
464 : # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
465 : # define CYTHON_UNUSED __attribute__ ((__unused__))
466 : # else
467 : # define CYTHON_UNUSED
468 : # endif
469 : #endif
470 : #ifndef CYTHON_UNUSED_VAR
471 : # if defined(__cplusplus)
472 : template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
473 : # else
474 : # define CYTHON_UNUSED_VAR(x) (void)(x)
475 : # endif
476 : #endif
477 : #ifndef CYTHON_MAYBE_UNUSED_VAR
478 : #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
479 : #endif
480 : #ifndef CYTHON_NCP_UNUSED
481 : # if CYTHON_COMPILING_IN_CPYTHON
482 : # define CYTHON_NCP_UNUSED
483 : # else
484 : # define CYTHON_NCP_UNUSED CYTHON_UNUSED
485 : # endif
486 : #endif
487 : #ifndef CYTHON_USE_CPP_STD_MOVE
488 : #if defined(__cplusplus) && (\
489 : __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
490 : #define CYTHON_USE_CPP_STD_MOVE 1
491 : #else
492 : #define CYTHON_USE_CPP_STD_MOVE 0
493 : #endif
494 : #endif
495 : #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
496 : #ifdef _MSC_VER
497 : #ifndef _MSC_STDINT_H_
498 : #if _MSC_VER < 1300
499 : typedef unsigned char uint8_t;
500 : typedef unsigned short uint16_t;
501 : typedef unsigned int uint32_t;
502 : #else
503 : typedef unsigned __int8 uint8_t;
504 : typedef unsigned __int16 uint16_t;
505 : typedef unsigned __int32 uint32_t;
506 : #endif
507 : #endif
508 : #if _MSC_VER < 1300
509 : #ifdef _WIN64
510 : typedef unsigned long long __pyx_uintptr_t;
511 : #else
512 : typedef unsigned int __pyx_uintptr_t;
513 : #endif
514 : #else
515 : #ifdef _WIN64
516 : typedef unsigned __int64 __pyx_uintptr_t;
517 : #else
518 : typedef unsigned __int32 __pyx_uintptr_t;
519 : #endif
520 : #endif
521 : #else
522 : #include <stdint.h>
523 : typedef uintptr_t __pyx_uintptr_t;
524 : #endif
525 : #ifndef CYTHON_FALLTHROUGH
526 : #if defined(__cplusplus)
527 : /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
528 : * but leads to warnings with -pedantic, since it is a C++17 feature */
529 : #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
530 : #if __has_cpp_attribute(fallthrough)
531 : #define CYTHON_FALLTHROUGH [[fallthrough]]
532 : #endif
533 : #endif
534 : #ifndef CYTHON_FALLTHROUGH
535 : #if __has_cpp_attribute(clang::fallthrough)
536 : #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
537 : #elif __has_cpp_attribute(gnu::fallthrough)
538 : #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
539 : #endif
540 : #endif
541 : #endif
542 : #ifndef CYTHON_FALLTHROUGH
543 : #if __has_attribute(fallthrough)
544 : #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
545 : #else
546 : #define CYTHON_FALLTHROUGH
547 : #endif
548 : #endif
549 : #if defined(__clang__) && defined(__apple_build_version__)
550 : #if __apple_build_version__ < 7000000
551 : #undef CYTHON_FALLTHROUGH
552 : #define CYTHON_FALLTHROUGH
553 : #endif
554 : #endif
555 : #endif
556 : #ifdef __cplusplus
557 : template <typename T>
558 : struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
559 : #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
560 : #else
561 : #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
562 : #endif
563 : #if CYTHON_COMPILING_IN_PYPY == 1
564 : #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
565 : #else
566 : #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
567 : #endif
568 : #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
569 :
570 : #ifndef CYTHON_INLINE
571 : #if defined(__clang__)
572 : #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
573 : #elif defined(__GNUC__)
574 : #define CYTHON_INLINE __inline__
575 : #elif defined(_MSC_VER)
576 : #define CYTHON_INLINE __inline
577 : #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
578 : #define CYTHON_INLINE inline
579 : #else
580 : #define CYTHON_INLINE
581 : #endif
582 : #endif
583 :
584 : #define __PYX_BUILD_PY_SSIZE_T "n"
585 : #define CYTHON_FORMAT_SSIZE_T "z"
586 : #if PY_MAJOR_VERSION < 3
587 : #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
588 : #define __Pyx_DefaultClassType PyClass_Type
589 : #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
590 : PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
591 : #else
592 : #define __Pyx_BUILTIN_MODULE_NAME "builtins"
593 : #define __Pyx_DefaultClassType PyType_Type
594 : #if CYTHON_COMPILING_IN_LIMITED_API
595 : static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
596 : PyObject *code, PyObject *c, PyObject* n, PyObject *v,
597 : PyObject *fv, PyObject *cell, PyObject* fn,
598 : PyObject *name, int fline, PyObject *lnos) {
599 : PyObject *exception_table = NULL;
600 : PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
601 : #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
602 : PyObject *version_info;
603 : PyObject *py_minor_version = NULL;
604 : #endif
605 : long minor_version = 0;
606 : PyObject *type, *value, *traceback;
607 : PyErr_Fetch(&type, &value, &traceback);
608 : #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
609 : minor_version = 11;
610 : #else
611 : if (!(version_info = PySys_GetObject("version_info"))) goto end;
612 : if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
613 : minor_version = PyLong_AsLong(py_minor_version);
614 : Py_DECREF(py_minor_version);
615 : if (minor_version == -1 && PyErr_Occurred()) goto end;
616 : #endif
617 : if (!(types_module = PyImport_ImportModule("types"))) goto end;
618 : if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
619 : if (minor_version <= 7) {
620 : (void)p;
621 : result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code,
622 : c, n, v, fn, name, fline, lnos, fv, cell);
623 : } else if (minor_version <= 10) {
624 : result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code,
625 : c, n, v, fn, name, fline, lnos, fv, cell);
626 : } else {
627 : if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
628 : result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code,
629 : c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
630 : }
631 : end:
632 : Py_XDECREF(code_type);
633 : Py_XDECREF(exception_table);
634 : Py_XDECREF(types_module);
635 : if (type) {
636 : PyErr_Restore(type, value, traceback);
637 : }
638 : return result;
639 : }
640 : #ifndef CO_OPTIMIZED
641 : #define CO_OPTIMIZED 0x0001
642 : #endif
643 : #ifndef CO_NEWLOCALS
644 : #define CO_NEWLOCALS 0x0002
645 : #endif
646 : #ifndef CO_VARARGS
647 : #define CO_VARARGS 0x0004
648 : #endif
649 : #ifndef CO_VARKEYWORDS
650 : #define CO_VARKEYWORDS 0x0008
651 : #endif
652 : #ifndef CO_ASYNC_GENERATOR
653 : #define CO_ASYNC_GENERATOR 0x0200
654 : #endif
655 : #ifndef CO_GENERATOR
656 : #define CO_GENERATOR 0x0020
657 : #endif
658 : #ifndef CO_COROUTINE
659 : #define CO_COROUTINE 0x0080
660 : #endif
661 : #elif PY_VERSION_HEX >= 0x030B0000
662 12 : static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
663 : PyObject *code, PyObject *c, PyObject* n, PyObject *v,
664 : PyObject *fv, PyObject *cell, PyObject* fn,
665 : PyObject *name, int fline, PyObject *lnos) {
666 12 : PyCodeObject *result;
667 12 : PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
668 12 : if (!empty_bytes) return NULL;
669 12 : result =
670 : #if PY_VERSION_HEX >= 0x030C0000
671 12 : PyUnstable_Code_NewWithPosOnlyArgs
672 : #else
673 : PyCode_NewWithPosOnlyArgs
674 : #endif
675 : (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes);
676 12 : Py_DECREF(empty_bytes);
677 : return result;
678 : }
679 : #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
680 : #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
681 : PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
682 : #else
683 : #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
684 : PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
685 : #endif
686 : #endif
687 : #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
688 : #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
689 : #else
690 : #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
691 : #endif
692 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
693 : #define __Pyx_Py_Is(x, y) Py_Is(x, y)
694 : #else
695 : #define __Pyx_Py_Is(x, y) ((x) == (y))
696 : #endif
697 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
698 : #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
699 : #else
700 : #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
701 : #endif
702 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
703 : #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
704 : #else
705 : #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
706 : #endif
707 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
708 : #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
709 : #else
710 : #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
711 : #endif
712 : #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
713 : #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
714 : #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
715 : #else
716 : #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
717 : #endif
718 : #ifndef CO_COROUTINE
719 : #define CO_COROUTINE 0x80
720 : #endif
721 : #ifndef CO_ASYNC_GENERATOR
722 : #define CO_ASYNC_GENERATOR 0x200
723 : #endif
724 : #ifndef Py_TPFLAGS_CHECKTYPES
725 : #define Py_TPFLAGS_CHECKTYPES 0
726 : #endif
727 : #ifndef Py_TPFLAGS_HAVE_INDEX
728 : #define Py_TPFLAGS_HAVE_INDEX 0
729 : #endif
730 : #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
731 : #define Py_TPFLAGS_HAVE_NEWBUFFER 0
732 : #endif
733 : #ifndef Py_TPFLAGS_HAVE_FINALIZE
734 : #define Py_TPFLAGS_HAVE_FINALIZE 0
735 : #endif
736 : #ifndef Py_TPFLAGS_SEQUENCE
737 : #define Py_TPFLAGS_SEQUENCE 0
738 : #endif
739 : #ifndef Py_TPFLAGS_MAPPING
740 : #define Py_TPFLAGS_MAPPING 0
741 : #endif
742 : #ifndef METH_STACKLESS
743 : #define METH_STACKLESS 0
744 : #endif
745 : #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
746 : #ifndef METH_FASTCALL
747 : #define METH_FASTCALL 0x80
748 : #endif
749 : typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
750 : typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
751 : Py_ssize_t nargs, PyObject *kwnames);
752 : #else
753 : #if PY_VERSION_HEX >= 0x030d00A4
754 : # define __Pyx_PyCFunctionFast PyCFunctionFast
755 : # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
756 : #else
757 : # define __Pyx_PyCFunctionFast _PyCFunctionFast
758 : # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
759 : #endif
760 : #endif
761 : #if CYTHON_METH_FASTCALL
762 : #define __Pyx_METH_FASTCALL METH_FASTCALL
763 : #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
764 : #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
765 : #else
766 : #define __Pyx_METH_FASTCALL METH_VARARGS
767 : #define __Pyx_PyCFunction_FastCall PyCFunction
768 : #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
769 : #endif
770 : #if CYTHON_VECTORCALL
771 : #define __pyx_vectorcallfunc vectorcallfunc
772 : #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
773 : #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
774 : #elif CYTHON_BACKPORT_VECTORCALL
775 : typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
776 : size_t nargsf, PyObject *kwnames);
777 : #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1))
778 : #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
779 : #else
780 : #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
781 : #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
782 : #endif
783 : #if PY_MAJOR_VERSION >= 0x030900B1
784 : #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
785 : #else
786 : #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func)
787 : #endif
788 : #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
789 : #if CYTHON_COMPILING_IN_CPYTHON
790 : #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
791 : #elif !CYTHON_COMPILING_IN_LIMITED_API
792 : #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
793 : #endif
794 : #if CYTHON_COMPILING_IN_CPYTHON
795 : #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
796 0 : static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
797 0 : return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
798 : }
799 : #endif
800 : static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) {
801 : #if CYTHON_COMPILING_IN_LIMITED_API
802 : return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
803 : #else
804 : return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
805 : #endif
806 : }
807 : #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
808 : #if __PYX_LIMITED_VERSION_HEX < 0x030900B1
809 : #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
810 : typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
811 : #else
812 : #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
813 : #define __Pyx_PyCMethod PyCMethod
814 : #endif
815 : #ifndef METH_METHOD
816 : #define METH_METHOD 0x200
817 : #endif
818 : #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
819 : #define PyObject_Malloc(s) PyMem_Malloc(s)
820 : #define PyObject_Free(p) PyMem_Free(p)
821 : #define PyObject_Realloc(p) PyMem_Realloc(p)
822 : #endif
823 : #if CYTHON_COMPILING_IN_LIMITED_API
824 : #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
825 : #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
826 : #else
827 : #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
828 : #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
829 : #endif
830 : #if CYTHON_COMPILING_IN_LIMITED_API
831 : #define __Pyx_PyThreadState_Current PyThreadState_Get()
832 : #elif !CYTHON_FAST_THREAD_STATE
833 : #define __Pyx_PyThreadState_Current PyThreadState_GET()
834 : #elif PY_VERSION_HEX >= 0x030d00A1
835 : #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
836 : #elif PY_VERSION_HEX >= 0x03060000
837 : #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
838 : #elif PY_VERSION_HEX >= 0x03000000
839 : #define __Pyx_PyThreadState_Current PyThreadState_GET()
840 : #else
841 : #define __Pyx_PyThreadState_Current _PyThreadState_Current
842 : #endif
843 : #if CYTHON_COMPILING_IN_LIMITED_API
844 : static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op)
845 : {
846 : void *result;
847 : result = PyModule_GetState(op);
848 : if (!result)
849 : Py_FatalError("Couldn't find the module state");
850 : return result;
851 : }
852 : #endif
853 : #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype)
854 : #if CYTHON_COMPILING_IN_LIMITED_API
855 : #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
856 : #else
857 : #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
858 : #endif
859 : #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
860 : #include "pythread.h"
861 : #define Py_tss_NEEDS_INIT 0
862 : typedef int Py_tss_t;
863 : static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
864 : *key = PyThread_create_key();
865 : return 0;
866 : }
867 : static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
868 : Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
869 : *key = Py_tss_NEEDS_INIT;
870 : return key;
871 : }
872 : static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
873 : PyObject_Free(key);
874 : }
875 : static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
876 : return *key != Py_tss_NEEDS_INIT;
877 : }
878 : static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
879 : PyThread_delete_key(*key);
880 : *key = Py_tss_NEEDS_INIT;
881 : }
882 : static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
883 : return PyThread_set_key_value(*key, value);
884 : }
885 : static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
886 : return PyThread_get_key_value(*key);
887 : }
888 : #endif
889 : #if PY_MAJOR_VERSION < 3
890 : #if CYTHON_COMPILING_IN_PYPY
891 : #if PYPY_VERSION_NUM < 0x07030600
892 : #if defined(__cplusplus) && __cplusplus >= 201402L
893 : [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]]
894 : #elif defined(__GNUC__) || defined(__clang__)
895 : __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")))
896 : #elif defined(_MSC_VER)
897 : __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))
898 : #endif
899 : static CYTHON_INLINE int PyGILState_Check(void) {
900 : return 0;
901 : }
902 : #else // PYPY_VERSION_NUM < 0x07030600
903 : #endif // PYPY_VERSION_NUM < 0x07030600
904 : #else
905 : static CYTHON_INLINE int PyGILState_Check(void) {
906 : PyThreadState * tstate = _PyThreadState_Current;
907 : return tstate && (tstate == PyGILState_GetThisThreadState());
908 : }
909 : #endif
910 : #endif
911 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized)
912 : #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
913 : #else
914 : #define __Pyx_PyDict_NewPresized(n) PyDict_New()
915 : #endif
916 : #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
917 : #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
918 : #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
919 : #else
920 : #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
921 : #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
922 : #endif
923 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS
924 : #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
925 0 : static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
926 0 : PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
927 0 : if (res == NULL) PyErr_Clear();
928 0 : return res;
929 : }
930 : #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
931 : #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
932 : #define __Pyx_PyDict_GetItemStr PyDict_GetItem
933 : #else
934 : static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
935 : #if CYTHON_COMPILING_IN_PYPY
936 : return PyDict_GetItem(dict, name);
937 : #else
938 : PyDictEntry *ep;
939 : PyDictObject *mp = (PyDictObject*) dict;
940 : long hash = ((PyStringObject *) name)->ob_shash;
941 : assert(hash != -1);
942 : ep = (mp->ma_lookup)(mp, name, hash);
943 : if (ep == NULL) {
944 : return NULL;
945 : }
946 : return ep->me_value;
947 : #endif
948 : }
949 : #define __Pyx_PyDict_GetItemStr PyDict_GetItem
950 : #endif
951 : #if CYTHON_USE_TYPE_SLOTS
952 : #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
953 : #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
954 : #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext)
955 : #else
956 : #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
957 : #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
958 : #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next
959 : #endif
960 : #if CYTHON_COMPILING_IN_LIMITED_API
961 : #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v)
962 : #else
963 : #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v)
964 : #endif
965 : #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
966 : #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
967 : PyTypeObject *type = Py_TYPE((PyObject*)obj);\
968 : assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
969 : PyObject_GC_Del(obj);\
970 : Py_DECREF(type);\
971 : }
972 : #else
973 : #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
974 : #endif
975 : #if CYTHON_COMPILING_IN_LIMITED_API
976 : #define CYTHON_PEP393_ENABLED 1
977 : #define __Pyx_PyUnicode_READY(op) (0)
978 : #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u)
979 : #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
980 : #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
981 : #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
982 : #define __Pyx_PyUnicode_DATA(u) ((void*)u)
983 : #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
984 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
985 : #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
986 : #define CYTHON_PEP393_ENABLED 1
987 : #if PY_VERSION_HEX >= 0x030C0000
988 : #define __Pyx_PyUnicode_READY(op) (0)
989 : #else
990 : #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
991 : 0 : _PyUnicode_Ready((PyObject *)(op)))
992 : #endif
993 : #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
994 : #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
995 : #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
996 : #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
997 : #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
998 : #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
999 : #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
1000 : #if PY_VERSION_HEX >= 0x030C0000
1001 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
1002 : #else
1003 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
1004 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
1005 : #else
1006 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
1007 : #endif
1008 : #endif
1009 : #else
1010 : #define CYTHON_PEP393_ENABLED 0
1011 : #define PyUnicode_1BYTE_KIND 1
1012 : #define PyUnicode_2BYTE_KIND 2
1013 : #define PyUnicode_4BYTE_KIND 4
1014 : #define __Pyx_PyUnicode_READY(op) (0)
1015 : #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
1016 : #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
1017 : #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U)
1018 : #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE))
1019 : #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
1020 : #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
1021 : #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch)
1022 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
1023 : #endif
1024 : #if CYTHON_COMPILING_IN_PYPY
1025 : #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
1026 : #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
1027 : #else
1028 : #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
1029 : #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
1030 : PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
1031 : #endif
1032 : #if CYTHON_COMPILING_IN_PYPY
1033 : #if !defined(PyUnicode_DecodeUnicodeEscape)
1034 : #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
1035 : #endif
1036 : #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
1037 : #undef PyUnicode_Contains
1038 : #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
1039 : #endif
1040 : #if !defined(PyByteArray_Check)
1041 : #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
1042 : #endif
1043 : #if !defined(PyObject_Format)
1044 : #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
1045 : #endif
1046 : #endif
1047 : #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
1048 : #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
1049 : #if PY_MAJOR_VERSION >= 3
1050 : #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
1051 : #else
1052 : #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
1053 : #endif
1054 : #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
1055 : #define PyObject_ASCII(o) PyObject_Repr(o)
1056 : #endif
1057 : #if PY_MAJOR_VERSION >= 3
1058 : #define PyBaseString_Type PyUnicode_Type
1059 : #define PyStringObject PyUnicodeObject
1060 : #define PyString_Type PyUnicode_Type
1061 : #define PyString_Check PyUnicode_Check
1062 : #define PyString_CheckExact PyUnicode_CheckExact
1063 : #ifndef PyObject_Unicode
1064 : #define PyObject_Unicode PyObject_Str
1065 : #endif
1066 : #endif
1067 : #if PY_MAJOR_VERSION >= 3
1068 : #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
1069 : #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
1070 : #else
1071 : #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
1072 : #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
1073 : #endif
1074 : #if CYTHON_COMPILING_IN_CPYTHON
1075 : #define __Pyx_PySequence_ListKeepNew(obj)\
1076 : (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
1077 : #else
1078 : #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
1079 : #endif
1080 : #ifndef PySet_CheckExact
1081 : #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type)
1082 : #endif
1083 : #if PY_VERSION_HEX >= 0x030900A4
1084 : #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
1085 : #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
1086 : #else
1087 : #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
1088 : #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
1089 : #endif
1090 : #if CYTHON_ASSUME_SAFE_MACROS
1091 : #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1092 : #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1093 : #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1094 : #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1095 : #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1096 : #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1097 : #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1098 : #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1099 : #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1100 : #else
1101 : #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1102 : #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1103 : #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1104 : #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1105 : #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1106 : #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1107 : #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1108 : #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1109 : #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1110 : #endif
1111 : #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
1112 : #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
1113 : #else
1114 12 : static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
1115 12 : PyObject *module = PyImport_AddModule(name);
1116 12 : Py_XINCREF(module);
1117 12 : return module;
1118 : }
1119 : #endif
1120 : #if PY_MAJOR_VERSION >= 3
1121 : #define PyIntObject PyLongObject
1122 : #define PyInt_Type PyLong_Type
1123 : #define PyInt_Check(op) PyLong_Check(op)
1124 : #define PyInt_CheckExact(op) PyLong_CheckExact(op)
1125 : #define __Pyx_Py3Int_Check(op) PyLong_Check(op)
1126 : #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op)
1127 : #define PyInt_FromString PyLong_FromString
1128 : #define PyInt_FromUnicode PyLong_FromUnicode
1129 : #define PyInt_FromLong PyLong_FromLong
1130 : #define PyInt_FromSize_t PyLong_FromSize_t
1131 : #define PyInt_FromSsize_t PyLong_FromSsize_t
1132 : #define PyInt_AsLong PyLong_AsLong
1133 : #define PyInt_AS_LONG PyLong_AS_LONG
1134 : #define PyInt_AsSsize_t PyLong_AsSsize_t
1135 : #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
1136 : #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
1137 : #define PyNumber_Int PyNumber_Long
1138 : #else
1139 : #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op))
1140 : #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op))
1141 : #endif
1142 : #if PY_MAJOR_VERSION >= 3
1143 : #define PyBoolObject PyLongObject
1144 : #endif
1145 : #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
1146 : #ifndef PyUnicode_InternFromString
1147 : #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1148 : #endif
1149 : #endif
1150 : #if PY_VERSION_HEX < 0x030200A4
1151 : typedef long Py_hash_t;
1152 : #define __Pyx_PyInt_FromHash_t PyInt_FromLong
1153 : #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
1154 : #else
1155 : #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
1156 : #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
1157 : #endif
1158 : #if CYTHON_USE_ASYNC_SLOTS
1159 : #if PY_VERSION_HEX >= 0x030500B1
1160 : #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1161 : #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
1162 : #else
1163 : #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
1164 : #endif
1165 : #else
1166 : #define __Pyx_PyType_AsAsync(obj) NULL
1167 : #endif
1168 : #ifndef __Pyx_PyAsyncMethodsStruct
1169 : typedef struct {
1170 : unaryfunc am_await;
1171 : unaryfunc am_aiter;
1172 : unaryfunc am_anext;
1173 : } __Pyx_PyAsyncMethodsStruct;
1174 : #endif
1175 :
1176 : #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1177 : #if !defined(_USE_MATH_DEFINES)
1178 : #define _USE_MATH_DEFINES
1179 : #endif
1180 : #endif
1181 : #include <math.h>
1182 : #ifdef NAN
1183 : #define __PYX_NAN() ((float) NAN)
1184 : #else
1185 : static CYTHON_INLINE float __PYX_NAN() {
1186 : float value;
1187 : memset(&value, 0xFF, sizeof(value));
1188 : return value;
1189 : }
1190 : #endif
1191 : #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1192 : #define __Pyx_truncl trunc
1193 : #else
1194 : #define __Pyx_truncl truncl
1195 : #endif
1196 :
1197 : #define __PYX_MARK_ERR_POS(f_index, lineno) \
1198 : { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
1199 : #define __PYX_ERR(f_index, lineno, Ln_error) \
1200 : { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1201 :
1202 : #ifdef CYTHON_EXTERN_C
1203 : #undef __PYX_EXTERN_C
1204 : #define __PYX_EXTERN_C CYTHON_EXTERN_C
1205 : #elif defined(__PYX_EXTERN_C)
1206 : #ifdef _MSC_VER
1207 : #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1208 : #else
1209 : #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1210 : #endif
1211 : #else
1212 : #ifdef __cplusplus
1213 : #define __PYX_EXTERN_C extern "C"
1214 : #else
1215 : #define __PYX_EXTERN_C extern
1216 : #endif
1217 : #endif
1218 :
1219 : #define __PYX_HAVE__scipy__sparse__csgraph___reordering
1220 : #define __PYX_HAVE_API__scipy__sparse__csgraph___reordering
1221 : /* Early includes */
1222 : #include <string.h>
1223 : #include <stdio.h>
1224 :
1225 : /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */
1226 :
1227 : #include "numpy/arrayobject.h"
1228 : #include "numpy/ndarrayobject.h"
1229 : #include "numpy/ndarraytypes.h"
1230 : #include "numpy/arrayscalars.h"
1231 : #include "numpy/ufuncobject.h"
1232 : #include "pythread.h"
1233 : #include <stdlib.h>
1234 : #ifdef _OPENMP
1235 : #include <omp.h>
1236 : #endif /* _OPENMP */
1237 :
1238 : #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1239 : #define CYTHON_WITHOUT_ASSERTIONS
1240 : #endif
1241 :
1242 : typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
1243 : const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
1244 :
1245 : #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1246 : #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1247 : #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
1248 : #define __PYX_DEFAULT_STRING_ENCODING ""
1249 : #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1250 : #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1251 : #define __Pyx_uchar_cast(c) ((unsigned char)c)
1252 : #define __Pyx_long_cast(x) ((long)x)
1253 : #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1254 : (sizeof(type) < sizeof(Py_ssize_t)) ||\
1255 : (sizeof(type) > sizeof(Py_ssize_t) &&\
1256 : likely(v < (type)PY_SSIZE_T_MAX ||\
1257 : v == (type)PY_SSIZE_T_MAX) &&\
1258 : (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1259 : v == (type)PY_SSIZE_T_MIN))) ||\
1260 : (sizeof(type) == sizeof(Py_ssize_t) &&\
1261 : (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1262 : v == (type)PY_SSIZE_T_MAX))) )
1263 20 : static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1264 20 : return (size_t) i < (size_t) limit;
1265 : }
1266 : #if defined (__cplusplus) && __cplusplus >= 201103L
1267 : #include <cstdlib>
1268 : #define __Pyx_sst_abs(value) std::abs(value)
1269 : #elif SIZEOF_INT >= SIZEOF_SIZE_T
1270 : #define __Pyx_sst_abs(value) abs(value)
1271 : #elif SIZEOF_LONG >= SIZEOF_SIZE_T
1272 : #define __Pyx_sst_abs(value) labs(value)
1273 : #elif defined (_MSC_VER)
1274 : #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1275 : #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1276 : #define __Pyx_sst_abs(value) llabs(value)
1277 : #elif defined (__GNUC__)
1278 : #define __Pyx_sst_abs(value) __builtin_llabs(value)
1279 : #else
1280 : #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1281 : #endif
1282 : static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
1283 : static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
1284 : static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1285 : static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
1286 : #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1287 : #define __Pyx_PyBytes_FromString PyBytes_FromString
1288 : #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1289 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
1290 : #if PY_MAJOR_VERSION < 3
1291 : #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
1292 : #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1293 : #else
1294 : #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
1295 : #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
1296 : #endif
1297 : #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1298 : #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1299 : #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1300 : #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1301 : #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1302 : #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1303 : #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1304 : #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1305 : #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1306 : #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1307 : #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1308 : #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1309 : #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1310 : #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1311 : #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
1312 : #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1313 : #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1314 : #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1315 : #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
1316 : #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
1317 : static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
1318 : static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
1319 : static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1320 : static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
1321 : #define __Pyx_PySequence_Tuple(obj)\
1322 : (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1323 : static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1324 : static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
1325 : static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1326 : #if CYTHON_ASSUME_SAFE_MACROS
1327 : #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1328 : #else
1329 : #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1330 : #endif
1331 : #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
1332 : #if PY_MAJOR_VERSION >= 3
1333 : #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1334 : #else
1335 : #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
1336 : #endif
1337 : #if CYTHON_USE_PYLONG_INTERNALS
1338 : #if PY_VERSION_HEX >= 0x030C00A7
1339 : #ifndef _PyLong_SIGN_MASK
1340 : #define _PyLong_SIGN_MASK 3
1341 : #endif
1342 : #ifndef _PyLong_NON_SIZE_BITS
1343 : #define _PyLong_NON_SIZE_BITS 3
1344 : #endif
1345 : #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
1346 : #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0)
1347 : #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1348 : #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1)
1349 : #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0)
1350 : #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1351 : #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1352 : #define __Pyx_PyLong_SignedDigitCount(x)\
1353 : ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1354 : #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1355 : #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1356 : #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1357 : #else
1358 : #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1359 : #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1360 : #endif
1361 : typedef Py_ssize_t __Pyx_compact_pylong;
1362 : typedef size_t __Pyx_compact_upylong;
1363 : #else
1364 : #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1365 : #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1366 : #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1367 : #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1368 : #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1369 : #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1370 : #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1371 : #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1372 : #define __Pyx_PyLong_CompactValue(x)\
1373 : ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1374 : typedef sdigit __Pyx_compact_pylong;
1375 : typedef digit __Pyx_compact_upylong;
1376 : #endif
1377 : #if PY_VERSION_HEX >= 0x030C00A5
1378 : #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1379 : #else
1380 : #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1381 : #endif
1382 : #endif
1383 : #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1384 : #include <string.h>
1385 : static int __Pyx_sys_getdefaultencoding_not_ascii;
1386 : static int __Pyx_init_sys_getdefaultencoding_params(void) {
1387 : PyObject* sys;
1388 : PyObject* default_encoding = NULL;
1389 : PyObject* ascii_chars_u = NULL;
1390 : PyObject* ascii_chars_b = NULL;
1391 : const char* default_encoding_c;
1392 : sys = PyImport_ImportModule("sys");
1393 : if (!sys) goto bad;
1394 : default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
1395 : Py_DECREF(sys);
1396 : if (!default_encoding) goto bad;
1397 : default_encoding_c = PyBytes_AsString(default_encoding);
1398 : if (!default_encoding_c) goto bad;
1399 : if (strcmp(default_encoding_c, "ascii") == 0) {
1400 : __Pyx_sys_getdefaultencoding_not_ascii = 0;
1401 : } else {
1402 : char ascii_chars[128];
1403 : int c;
1404 : for (c = 0; c < 128; c++) {
1405 : ascii_chars[c] = (char) c;
1406 : }
1407 : __Pyx_sys_getdefaultencoding_not_ascii = 1;
1408 : ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1409 : if (!ascii_chars_u) goto bad;
1410 : ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1411 : if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1412 : PyErr_Format(
1413 : PyExc_ValueError,
1414 : "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1415 : default_encoding_c);
1416 : goto bad;
1417 : }
1418 : Py_DECREF(ascii_chars_u);
1419 : Py_DECREF(ascii_chars_b);
1420 : }
1421 : Py_DECREF(default_encoding);
1422 : return 0;
1423 : bad:
1424 : Py_XDECREF(default_encoding);
1425 : Py_XDECREF(ascii_chars_u);
1426 : Py_XDECREF(ascii_chars_b);
1427 : return -1;
1428 : }
1429 : #endif
1430 : #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1431 : #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1432 : #else
1433 : #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1434 : #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1435 : #include <string.h>
1436 : static char* __PYX_DEFAULT_STRING_ENCODING;
1437 : static int __Pyx_init_sys_getdefaultencoding_params(void) {
1438 : PyObject* sys;
1439 : PyObject* default_encoding = NULL;
1440 : char* default_encoding_c;
1441 : sys = PyImport_ImportModule("sys");
1442 : if (!sys) goto bad;
1443 : default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
1444 : Py_DECREF(sys);
1445 : if (!default_encoding) goto bad;
1446 : default_encoding_c = PyBytes_AsString(default_encoding);
1447 : if (!default_encoding_c) goto bad;
1448 : __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
1449 : if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
1450 : strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1451 : Py_DECREF(default_encoding);
1452 : return 0;
1453 : bad:
1454 : Py_XDECREF(default_encoding);
1455 : return -1;
1456 : }
1457 : #endif
1458 : #endif
1459 :
1460 :
1461 : /* Test for GCC > 2.95 */
1462 : #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1463 : #define likely(x) __builtin_expect(!!(x), 1)
1464 : #define unlikely(x) __builtin_expect(!!(x), 0)
1465 : #else /* !__GNUC__ or GCC < 2.95 */
1466 : #define likely(x) (x)
1467 : #define unlikely(x) (x)
1468 : #endif /* __GNUC__ */
1469 : static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1470 :
1471 : #if !CYTHON_USE_MODULE_STATE
1472 : static PyObject *__pyx_m = NULL;
1473 : #endif
1474 : static int __pyx_lineno;
1475 : static int __pyx_clineno = 0;
1476 : static const char * __pyx_cfilenm = __FILE__;
1477 : static const char *__pyx_filename;
1478 :
1479 : /* Header.proto */
1480 : #if !defined(CYTHON_CCOMPLEX)
1481 : #if defined(__cplusplus)
1482 : #define CYTHON_CCOMPLEX 1
1483 : #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
1484 : #define CYTHON_CCOMPLEX 1
1485 : #else
1486 : #define CYTHON_CCOMPLEX 0
1487 : #endif
1488 : #endif
1489 : #if CYTHON_CCOMPLEX
1490 : #ifdef __cplusplus
1491 : #include <complex>
1492 : #else
1493 : #include <complex.h>
1494 : #endif
1495 : #endif
1496 : #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1497 : #undef _Complex_I
1498 : #define _Complex_I 1.0fj
1499 : #endif
1500 :
1501 : /* #### Code section: filename_table ### */
1502 :
1503 : static const char *__pyx_f[] = {
1504 : "_reordering.pyx",
1505 : "<stringsource>",
1506 : "__init__.cython-30.pxd",
1507 : "type.pxd",
1508 : "parameters.pxi",
1509 : };
1510 : /* #### Code section: utility_code_proto_before_types ### */
1511 : /* ForceInitThreads.proto */
1512 : #ifndef __PYX_FORCE_INIT_THREADS
1513 : #define __PYX_FORCE_INIT_THREADS 0
1514 : #endif
1515 :
1516 : /* NoFastGil.proto */
1517 : #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1518 : #define __Pyx_PyGILState_Release PyGILState_Release
1519 : #define __Pyx_FastGIL_Remember()
1520 : #define __Pyx_FastGIL_Forget()
1521 : #define __Pyx_FastGilFuncInit()
1522 :
1523 : /* BufferFormatStructs.proto */
1524 : struct __Pyx_StructField_;
1525 : #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1526 : typedef struct {
1527 : const char* name;
1528 : struct __Pyx_StructField_* fields;
1529 : size_t size;
1530 : size_t arraysize[8];
1531 : int ndim;
1532 : char typegroup;
1533 : char is_unsigned;
1534 : int flags;
1535 : } __Pyx_TypeInfo;
1536 : typedef struct __Pyx_StructField_ {
1537 : __Pyx_TypeInfo* type;
1538 : const char* name;
1539 : size_t offset;
1540 : } __Pyx_StructField;
1541 : typedef struct {
1542 : __Pyx_StructField* field;
1543 : size_t parent_offset;
1544 : } __Pyx_BufFmt_StackElem;
1545 : typedef struct {
1546 : __Pyx_StructField root;
1547 : __Pyx_BufFmt_StackElem* head;
1548 : size_t fmt_offset;
1549 : size_t new_count, enc_count;
1550 : size_t struct_alignment;
1551 : int is_complex;
1552 : char enc_type;
1553 : char new_packmode;
1554 : char enc_packmode;
1555 : char is_valid_array;
1556 : } __Pyx_BufFmt_Context;
1557 :
1558 : /* Atomics.proto */
1559 : #include <pythread.h>
1560 : #ifndef CYTHON_ATOMICS
1561 : #define CYTHON_ATOMICS 1
1562 : #endif
1563 : #define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1564 : #define __pyx_atomic_int_type int
1565 : #define __pyx_nonatomic_int_type int
1566 : #if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1567 : (__STDC_VERSION__ >= 201112L) &&\
1568 : !defined(__STDC_NO_ATOMICS__))
1569 : #include <stdatomic.h>
1570 : #elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1571 : (__cplusplus >= 201103L) ||\
1572 : (defined(_MSC_VER) && _MSC_VER >= 1700)))
1573 : #include <atomic>
1574 : #endif
1575 : #if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1576 : (__STDC_VERSION__ >= 201112L) &&\
1577 : !defined(__STDC_NO_ATOMICS__) &&\
1578 : ATOMIC_INT_LOCK_FREE == 2)
1579 : #undef __pyx_atomic_int_type
1580 : #define __pyx_atomic_int_type atomic_int
1581 : #define __pyx_atomic_incr_aligned(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
1582 : #define __pyx_atomic_decr_aligned(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
1583 : #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1584 : #pragma message ("Using standard C atomics")
1585 : #elif defined(__PYX_DEBUG_ATOMICS)
1586 : #warning "Using standard C atomics"
1587 : #endif
1588 : #elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1589 : (__cplusplus >= 201103L) ||\
1590 : \
1591 : (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
1592 : ATOMIC_INT_LOCK_FREE == 2)
1593 : #undef __pyx_atomic_int_type
1594 : #define __pyx_atomic_int_type std::atomic_int
1595 : #define __pyx_atomic_incr_aligned(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
1596 : #define __pyx_atomic_decr_aligned(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
1597 : #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1598 : #pragma message ("Using standard C++ atomics")
1599 : #elif defined(__PYX_DEBUG_ATOMICS)
1600 : #warning "Using standard C++ atomics"
1601 : #endif
1602 : #elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1603 : (__GNUC_MINOR__ > 1 ||\
1604 : (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1605 : #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
1606 : #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1)
1607 : #ifdef __PYX_DEBUG_ATOMICS
1608 : #warning "Using GNU atomics"
1609 : #endif
1610 : #elif CYTHON_ATOMICS && defined(_MSC_VER)
1611 : #include <intrin.h>
1612 : #undef __pyx_atomic_int_type
1613 : #define __pyx_atomic_int_type long
1614 : #undef __pyx_nonatomic_int_type
1615 : #define __pyx_nonatomic_int_type long
1616 : #pragma intrinsic (_InterlockedExchangeAdd)
1617 : #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
1618 : #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
1619 : #ifdef __PYX_DEBUG_ATOMICS
1620 : #pragma message ("Using MSVC atomics")
1621 : #endif
1622 : #else
1623 : #undef CYTHON_ATOMICS
1624 : #define CYTHON_ATOMICS 0
1625 : #ifdef __PYX_DEBUG_ATOMICS
1626 : #warning "Not using atomics"
1627 : #endif
1628 : #endif
1629 : #if CYTHON_ATOMICS
1630 : #define __pyx_add_acquisition_count(memview)\
1631 : __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
1632 : #define __pyx_sub_acquisition_count(memview)\
1633 : __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
1634 : #else
1635 : #define __pyx_add_acquisition_count(memview)\
1636 : __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1637 : #define __pyx_sub_acquisition_count(memview)\
1638 : __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1639 : #endif
1640 :
1641 : /* MemviewSliceStruct.proto */
1642 : struct __pyx_memoryview_obj;
1643 : typedef struct {
1644 : struct __pyx_memoryview_obj *memview;
1645 : char *data;
1646 : Py_ssize_t shape[8];
1647 : Py_ssize_t strides[8];
1648 : Py_ssize_t suboffsets[8];
1649 : } __Pyx_memviewslice;
1650 : #define __Pyx_MemoryView_Len(m) (m.shape[0])
1651 :
1652 : /* #### Code section: numeric_typedefs ### */
1653 :
1654 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":769
1655 : * # in Cython to enable them only on the right systems.
1656 : *
1657 : * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1658 : * ctypedef npy_int16 int16_t
1659 : * ctypedef npy_int32 int32_t
1660 : */
1661 : typedef npy_int8 __pyx_t_5numpy_int8_t;
1662 :
1663 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":770
1664 : *
1665 : * ctypedef npy_int8 int8_t
1666 : * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1667 : * ctypedef npy_int32 int32_t
1668 : * ctypedef npy_int64 int64_t
1669 : */
1670 : typedef npy_int16 __pyx_t_5numpy_int16_t;
1671 :
1672 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":771
1673 : * ctypedef npy_int8 int8_t
1674 : * ctypedef npy_int16 int16_t
1675 : * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1676 : * ctypedef npy_int64 int64_t
1677 : * #ctypedef npy_int96 int96_t
1678 : */
1679 : typedef npy_int32 __pyx_t_5numpy_int32_t;
1680 :
1681 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":772
1682 : * ctypedef npy_int16 int16_t
1683 : * ctypedef npy_int32 int32_t
1684 : * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1685 : * #ctypedef npy_int96 int96_t
1686 : * #ctypedef npy_int128 int128_t
1687 : */
1688 : typedef npy_int64 __pyx_t_5numpy_int64_t;
1689 :
1690 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":776
1691 : * #ctypedef npy_int128 int128_t
1692 : *
1693 : * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1694 : * ctypedef npy_uint16 uint16_t
1695 : * ctypedef npy_uint32 uint32_t
1696 : */
1697 : typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1698 :
1699 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":777
1700 : *
1701 : * ctypedef npy_uint8 uint8_t
1702 : * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1703 : * ctypedef npy_uint32 uint32_t
1704 : * ctypedef npy_uint64 uint64_t
1705 : */
1706 : typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1707 :
1708 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":778
1709 : * ctypedef npy_uint8 uint8_t
1710 : * ctypedef npy_uint16 uint16_t
1711 : * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1712 : * ctypedef npy_uint64 uint64_t
1713 : * #ctypedef npy_uint96 uint96_t
1714 : */
1715 : typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1716 :
1717 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":779
1718 : * ctypedef npy_uint16 uint16_t
1719 : * ctypedef npy_uint32 uint32_t
1720 : * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1721 : * #ctypedef npy_uint96 uint96_t
1722 : * #ctypedef npy_uint128 uint128_t
1723 : */
1724 : typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1725 :
1726 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":783
1727 : * #ctypedef npy_uint128 uint128_t
1728 : *
1729 : * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1730 : * ctypedef npy_float64 float64_t
1731 : * #ctypedef npy_float80 float80_t
1732 : */
1733 : typedef npy_float32 __pyx_t_5numpy_float32_t;
1734 :
1735 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":784
1736 : *
1737 : * ctypedef npy_float32 float32_t
1738 : * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1739 : * #ctypedef npy_float80 float80_t
1740 : * #ctypedef npy_float128 float128_t
1741 : */
1742 : typedef npy_float64 __pyx_t_5numpy_float64_t;
1743 :
1744 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":791
1745 : * ctypedef double complex complex128_t
1746 : *
1747 : * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1748 : * ctypedef npy_ulonglong ulonglong_t
1749 : *
1750 : */
1751 : typedef npy_longlong __pyx_t_5numpy_longlong_t;
1752 :
1753 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":792
1754 : *
1755 : * ctypedef npy_longlong longlong_t
1756 : * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1757 : *
1758 : * ctypedef npy_intp intp_t
1759 : */
1760 : typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1761 :
1762 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":794
1763 : * ctypedef npy_ulonglong ulonglong_t
1764 : *
1765 : * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1766 : * ctypedef npy_uintp uintp_t
1767 : *
1768 : */
1769 : typedef npy_intp __pyx_t_5numpy_intp_t;
1770 :
1771 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":795
1772 : *
1773 : * ctypedef npy_intp intp_t
1774 : * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1775 : *
1776 : * ctypedef npy_double float_t
1777 : */
1778 : typedef npy_uintp __pyx_t_5numpy_uintp_t;
1779 :
1780 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":797
1781 : * ctypedef npy_uintp uintp_t
1782 : *
1783 : * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1784 : * ctypedef npy_double double_t
1785 : * ctypedef npy_longdouble longdouble_t
1786 : */
1787 : typedef npy_double __pyx_t_5numpy_float_t;
1788 :
1789 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":798
1790 : *
1791 : * ctypedef npy_double float_t
1792 : * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1793 : * ctypedef npy_longdouble longdouble_t
1794 : *
1795 : */
1796 : typedef npy_double __pyx_t_5numpy_double_t;
1797 :
1798 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":799
1799 : * ctypedef npy_double float_t
1800 : * ctypedef npy_double double_t
1801 : * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1802 : *
1803 : * ctypedef float complex cfloat_t
1804 : */
1805 : typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1806 :
1807 : /* "../scipy/sparse/csgraph/parameters.pxi":3
1808 : *
1809 : * DTYPE = np.float64
1810 : * ctypedef np.float64_t DTYPE_t # <<<<<<<<<<<<<<
1811 : *
1812 : * ITYPE = np.int32
1813 : */
1814 : typedef __pyx_t_5numpy_float64_t __pyx_t_5scipy_6sparse_7csgraph_11_reordering_DTYPE_t;
1815 :
1816 : /* "../scipy/sparse/csgraph/parameters.pxi":6
1817 : *
1818 : * ITYPE = np.int32
1819 : * ctypedef np.int32_t ITYPE_t # <<<<<<<<<<<<<<
1820 : *
1821 : * # Fused type for int32 and int64
1822 : */
1823 : typedef __pyx_t_5numpy_int32_t __pyx_t_5scipy_6sparse_7csgraph_11_reordering_ITYPE_t;
1824 : /* #### Code section: complex_type_declarations ### */
1825 : /* Declarations.proto */
1826 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1827 : #ifdef __cplusplus
1828 : typedef ::std::complex< float > __pyx_t_float_complex;
1829 : #else
1830 : typedef float _Complex __pyx_t_float_complex;
1831 : #endif
1832 : #else
1833 : typedef struct { float real, imag; } __pyx_t_float_complex;
1834 : #endif
1835 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1836 :
1837 : /* Declarations.proto */
1838 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1839 : #ifdef __cplusplus
1840 : typedef ::std::complex< double > __pyx_t_double_complex;
1841 : #else
1842 : typedef double _Complex __pyx_t_double_complex;
1843 : #endif
1844 : #else
1845 : typedef struct { double real, imag; } __pyx_t_double_complex;
1846 : #endif
1847 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1848 :
1849 : /* Declarations.proto */
1850 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1851 : #ifdef __cplusplus
1852 : typedef ::std::complex< long double > __pyx_t_long_double_complex;
1853 : #else
1854 : typedef long double _Complex __pyx_t_long_double_complex;
1855 : #endif
1856 : #else
1857 : typedef struct { long double real, imag; } __pyx_t_long_double_complex;
1858 : #endif
1859 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);
1860 :
1861 : /* #### Code section: type_declarations ### */
1862 :
1863 : /*--- Type declarations ---*/
1864 : struct __pyx_array_obj;
1865 : struct __pyx_MemviewEnum_obj;
1866 : struct __pyx_memoryview_obj;
1867 : struct __pyx_memoryviewslice_obj;
1868 :
1869 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1095
1870 : *
1871 : * # Iterator API added in v1.6
1872 : * ctypedef int (*NpyIter_IterNextFunc)(NpyIter* it) noexcept nogil # <<<<<<<<<<<<<<
1873 : * ctypedef void (*NpyIter_GetMultiIndexFunc)(NpyIter* it, npy_intp* outcoords) noexcept nogil
1874 : *
1875 : */
1876 : typedef int (*__pyx_t_5numpy_NpyIter_IterNextFunc)(NpyIter *);
1877 :
1878 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1096
1879 : * # Iterator API added in v1.6
1880 : * ctypedef int (*NpyIter_IterNextFunc)(NpyIter* it) noexcept nogil
1881 : * ctypedef void (*NpyIter_GetMultiIndexFunc)(NpyIter* it, npy_intp* outcoords) noexcept nogil # <<<<<<<<<<<<<<
1882 : *
1883 : * cdef extern from "numpy/arrayobject.h":
1884 : */
1885 : typedef void (*__pyx_t_5numpy_NpyIter_GetMultiIndexFunc)(NpyIter *, npy_intp *);
1886 : struct __pyx_defaults;
1887 : typedef struct __pyx_defaults __pyx_defaults;
1888 : struct __pyx_defaults {
1889 : PyObject *__pyx_arg__fused_sigindex;
1890 : };
1891 :
1892 : /* "View.MemoryView":114
1893 : * @cython.collection_type("sequence")
1894 : * @cname("__pyx_array")
1895 : * cdef class array: # <<<<<<<<<<<<<<
1896 : *
1897 : * cdef:
1898 : */
1899 : struct __pyx_array_obj {
1900 : PyObject_HEAD
1901 : struct __pyx_vtabstruct_array *__pyx_vtab;
1902 : char *data;
1903 : Py_ssize_t len;
1904 : char *format;
1905 : int ndim;
1906 : Py_ssize_t *_shape;
1907 : Py_ssize_t *_strides;
1908 : Py_ssize_t itemsize;
1909 : PyObject *mode;
1910 : PyObject *_format;
1911 : void (*callback_free_data)(void *);
1912 : int free_data;
1913 : int dtype_is_object;
1914 : };
1915 :
1916 :
1917 : /* "View.MemoryView":302
1918 : *
1919 : * @cname('__pyx_MemviewEnum')
1920 : * cdef class Enum(object): # <<<<<<<<<<<<<<
1921 : * cdef object name
1922 : * def __init__(self, name):
1923 : */
1924 : struct __pyx_MemviewEnum_obj {
1925 : PyObject_HEAD
1926 : PyObject *name;
1927 : };
1928 :
1929 :
1930 : /* "View.MemoryView":337
1931 : *
1932 : * @cname('__pyx_memoryview')
1933 : * cdef class memoryview: # <<<<<<<<<<<<<<
1934 : *
1935 : * cdef object obj
1936 : */
1937 : struct __pyx_memoryview_obj {
1938 : PyObject_HEAD
1939 : struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1940 : PyObject *obj;
1941 : PyObject *_size;
1942 : PyObject *_array_interface;
1943 : PyThread_type_lock lock;
1944 : __pyx_atomic_int_type acquisition_count;
1945 : Py_buffer view;
1946 : int flags;
1947 : int dtype_is_object;
1948 : __Pyx_TypeInfo *typeinfo;
1949 : };
1950 :
1951 :
1952 : /* "View.MemoryView":952
1953 : * @cython.collection_type("sequence")
1954 : * @cname('__pyx_memoryviewslice')
1955 : * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1956 : * "Internal class for passing memoryview slices to Python"
1957 : *
1958 : */
1959 : struct __pyx_memoryviewslice_obj {
1960 : struct __pyx_memoryview_obj __pyx_base;
1961 : __Pyx_memviewslice from_slice;
1962 : PyObject *from_object;
1963 : PyObject *(*to_object_func)(char *);
1964 : int (*to_dtype_func)(char *, PyObject *);
1965 : };
1966 :
1967 :
1968 :
1969 : /* "View.MemoryView":114
1970 : * @cython.collection_type("sequence")
1971 : * @cname("__pyx_array")
1972 : * cdef class array: # <<<<<<<<<<<<<<
1973 : *
1974 : * cdef:
1975 : */
1976 :
1977 : struct __pyx_vtabstruct_array {
1978 : PyObject *(*get_memview)(struct __pyx_array_obj *);
1979 : };
1980 : static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1981 :
1982 :
1983 : /* "View.MemoryView":337
1984 : *
1985 : * @cname('__pyx_memoryview')
1986 : * cdef class memoryview: # <<<<<<<<<<<<<<
1987 : *
1988 : * cdef object obj
1989 : */
1990 :
1991 : struct __pyx_vtabstruct_memoryview {
1992 : char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1993 : PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1994 : PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1995 : PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1996 : PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1997 : PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1998 : PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1999 : PyObject *(*_get_base)(struct __pyx_memoryview_obj *);
2000 : };
2001 : static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
2002 :
2003 :
2004 : /* "View.MemoryView":952
2005 : * @cython.collection_type("sequence")
2006 : * @cname('__pyx_memoryviewslice')
2007 : * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
2008 : * "Internal class for passing memoryview slices to Python"
2009 : *
2010 : */
2011 :
2012 : struct __pyx_vtabstruct__memoryviewslice {
2013 : struct __pyx_vtabstruct_memoryview __pyx_base;
2014 : };
2015 : static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
2016 : /* #### Code section: utility_code_proto ### */
2017 :
2018 : /* --- Runtime support code (head) --- */
2019 : /* Refnanny.proto */
2020 : #ifndef CYTHON_REFNANNY
2021 : #define CYTHON_REFNANNY 0
2022 : #endif
2023 : #if CYTHON_REFNANNY
2024 : typedef struct {
2025 : void (*INCREF)(void*, PyObject*, Py_ssize_t);
2026 : void (*DECREF)(void*, PyObject*, Py_ssize_t);
2027 : void (*GOTREF)(void*, PyObject*, Py_ssize_t);
2028 : void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
2029 : void* (*SetupContext)(const char*, Py_ssize_t, const char*);
2030 : void (*FinishContext)(void**);
2031 : } __Pyx_RefNannyAPIStruct;
2032 : static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
2033 : static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
2034 : #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
2035 : #ifdef WITH_THREAD
2036 : #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2037 : if (acquire_gil) {\
2038 : PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2039 : __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2040 : PyGILState_Release(__pyx_gilstate_save);\
2041 : } else {\
2042 : __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2043 : }
2044 : #define __Pyx_RefNannyFinishContextNogil() {\
2045 : PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2046 : __Pyx_RefNannyFinishContext();\
2047 : PyGILState_Release(__pyx_gilstate_save);\
2048 : }
2049 : #else
2050 : #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2051 : __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__))
2052 : #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext()
2053 : #endif
2054 : #define __Pyx_RefNannyFinishContextNogil() {\
2055 : PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2056 : __Pyx_RefNannyFinishContext();\
2057 : PyGILState_Release(__pyx_gilstate_save);\
2058 : }
2059 : #define __Pyx_RefNannyFinishContext()\
2060 : __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
2061 : #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2062 : #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2063 : #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2064 : #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2065 : #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
2066 : #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
2067 : #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
2068 : #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
2069 : #else
2070 : #define __Pyx_RefNannyDeclarations
2071 : #define __Pyx_RefNannySetupContext(name, acquire_gil)
2072 : #define __Pyx_RefNannyFinishContextNogil()
2073 : #define __Pyx_RefNannyFinishContext()
2074 : #define __Pyx_INCREF(r) Py_INCREF(r)
2075 : #define __Pyx_DECREF(r) Py_DECREF(r)
2076 : #define __Pyx_GOTREF(r)
2077 : #define __Pyx_GIVEREF(r)
2078 : #define __Pyx_XINCREF(r) Py_XINCREF(r)
2079 : #define __Pyx_XDECREF(r) Py_XDECREF(r)
2080 : #define __Pyx_XGOTREF(r)
2081 : #define __Pyx_XGIVEREF(r)
2082 : #endif
2083 : #define __Pyx_Py_XDECREF_SET(r, v) do {\
2084 : PyObject *tmp = (PyObject *) r;\
2085 : r = v; Py_XDECREF(tmp);\
2086 : } while (0)
2087 : #define __Pyx_XDECREF_SET(r, v) do {\
2088 : PyObject *tmp = (PyObject *) r;\
2089 : r = v; __Pyx_XDECREF(tmp);\
2090 : } while (0)
2091 : #define __Pyx_DECREF_SET(r, v) do {\
2092 : PyObject *tmp = (PyObject *) r;\
2093 : r = v; __Pyx_DECREF(tmp);\
2094 : } while (0)
2095 : #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2096 : #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2097 :
2098 : /* PyErrExceptionMatches.proto */
2099 : #if CYTHON_FAST_THREAD_STATE
2100 : #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2101 : static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2102 : #else
2103 : #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2104 : #endif
2105 :
2106 : /* PyThreadStateGet.proto */
2107 : #if CYTHON_FAST_THREAD_STATE
2108 : #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2109 : #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2110 : #if PY_VERSION_HEX >= 0x030C00A6
2111 : #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
2112 : #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
2113 : #else
2114 : #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2115 : #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2116 : #endif
2117 : #else
2118 : #define __Pyx_PyThreadState_declare
2119 : #define __Pyx_PyThreadState_assign
2120 : #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
2121 : #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
2122 : #endif
2123 :
2124 : /* PyErrFetchRestore.proto */
2125 : #if CYTHON_FAST_THREAD_STATE
2126 : #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2127 : #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2128 : #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2129 : #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2130 : #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2131 : static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2132 : static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2133 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
2134 : #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2135 : #else
2136 : #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2137 : #endif
2138 : #else
2139 : #define __Pyx_PyErr_Clear() PyErr_Clear()
2140 : #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2141 : #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2142 : #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2143 : #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2144 : #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2145 : #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2146 : #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2147 : #endif
2148 :
2149 : /* PyObjectGetAttrStr.proto */
2150 : #if CYTHON_USE_TYPE_SLOTS
2151 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2152 : #else
2153 : #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2154 : #endif
2155 :
2156 : /* PyObjectGetAttrStrNoError.proto */
2157 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2158 :
2159 : /* GetBuiltinName.proto */
2160 : static PyObject *__Pyx_GetBuiltinName(PyObject *name);
2161 :
2162 : /* TupleAndListFromArray.proto */
2163 : #if CYTHON_COMPILING_IN_CPYTHON
2164 : static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
2165 : static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
2166 : #endif
2167 :
2168 : /* IncludeStringH.proto */
2169 : #include <string.h>
2170 :
2171 : /* BytesEquals.proto */
2172 : static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2173 :
2174 : /* UnicodeEquals.proto */
2175 : static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2176 :
2177 : /* fastcall.proto */
2178 : #if CYTHON_AVOID_BORROWED_REFS
2179 : #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i)
2180 : #elif CYTHON_ASSUME_SAFE_MACROS
2181 : #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i)
2182 : #else
2183 : #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i)
2184 : #endif
2185 : #if CYTHON_AVOID_BORROWED_REFS
2186 : #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg)
2187 : #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg)
2188 : #else
2189 : #define __Pyx_Arg_NewRef_VARARGS(arg) arg
2190 : #define __Pyx_Arg_XDECREF_VARARGS(arg)
2191 : #endif
2192 : #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2193 : #define __Pyx_KwValues_VARARGS(args, nargs) NULL
2194 : #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2195 : #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2196 : #if CYTHON_METH_FASTCALL
2197 : #define __Pyx_Arg_FASTCALL(args, i) args[i]
2198 : #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
2199 : #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2200 : static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
2201 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
2202 : CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
2203 : #else
2204 : #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2205 : #endif
2206 : #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs
2207 : to have the same reference counting */
2208 : #define __Pyx_Arg_XDECREF_FASTCALL(arg)
2209 : #else
2210 : #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
2211 : #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2212 : #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2213 : #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2214 : #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2215 : #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg)
2216 : #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg)
2217 : #endif
2218 : #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2219 : #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start)
2220 : #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start)
2221 : #else
2222 : #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2223 : #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
2224 : #endif
2225 :
2226 : /* RaiseArgTupleInvalid.proto */
2227 : static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
2228 : Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2229 :
2230 : /* RaiseDoubleKeywords.proto */
2231 : static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
2232 :
2233 : /* ParseKeywords.proto */
2234 : static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues,
2235 : PyObject **argnames[],
2236 : PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,
2237 : const char* function_name);
2238 :
2239 : /* ArgTypeTest.proto */
2240 : #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2241 : ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2242 : __Pyx__ArgTypeTest(obj, type, name, exact))
2243 : static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2244 :
2245 : /* RaiseException.proto */
2246 : static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2247 :
2248 : /* PyFunctionFastCall.proto */
2249 : #if CYTHON_FAST_PYCALL
2250 : #if !CYTHON_VECTORCALL
2251 : #define __Pyx_PyFunction_FastCall(func, args, nargs)\
2252 : __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
2253 : static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
2254 : #endif
2255 : #define __Pyx_BUILD_ASSERT_EXPR(cond)\
2256 : (sizeof(char [1 - 2*!(cond)]) - 1)
2257 : #ifndef Py_MEMBER_SIZE
2258 : #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
2259 : #endif
2260 : #if !CYTHON_VECTORCALL
2261 : #if PY_VERSION_HEX >= 0x03080000
2262 : #include "frameobject.h"
2263 : #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
2264 : #ifndef Py_BUILD_CORE
2265 : #define Py_BUILD_CORE 1
2266 : #endif
2267 : #include "internal/pycore_frame.h"
2268 : #endif
2269 : #define __Pxy_PyFrame_Initialize_Offsets()
2270 : #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus)
2271 : #else
2272 : static size_t __pyx_pyframe_localsplus_offset = 0;
2273 : #include "frameobject.h"
2274 : #define __Pxy_PyFrame_Initialize_Offsets()\
2275 : ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
2276 : (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
2277 : #define __Pyx_PyFrame_GetLocalsplus(frame)\
2278 : (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
2279 : #endif
2280 : #endif
2281 : #endif
2282 :
2283 : /* PyObjectCall.proto */
2284 : #if CYTHON_COMPILING_IN_CPYTHON
2285 : static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2286 : #else
2287 : #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2288 : #endif
2289 :
2290 : /* PyObjectCallMethO.proto */
2291 : #if CYTHON_COMPILING_IN_CPYTHON
2292 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2293 : #endif
2294 :
2295 : /* PyObjectFastCall.proto */
2296 : #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
2297 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs);
2298 :
2299 : /* RaiseUnexpectedTypeError.proto */
2300 : static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);
2301 :
2302 : /* GCCDiagnostics.proto */
2303 : #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2304 : #define __Pyx_HAS_GCC_DIAGNOSTIC
2305 : #endif
2306 :
2307 : /* BuildPyUnicode.proto */
2308 : static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
2309 : int prepend_sign, char padding_char);
2310 :
2311 : /* CIntToPyUnicode.proto */
2312 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);
2313 :
2314 : /* CIntToPyUnicode.proto */
2315 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);
2316 :
2317 : /* JoinPyUnicode.proto */
2318 : static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
2319 : Py_UCS4 max_char);
2320 :
2321 : /* StrEquals.proto */
2322 : #if PY_MAJOR_VERSION >= 3
2323 : #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2324 : #else
2325 : #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2326 : #endif
2327 :
2328 : /* PyObjectFormatSimple.proto */
2329 : #if CYTHON_COMPILING_IN_PYPY
2330 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2331 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2332 : PyObject_Format(s, f))
2333 : #elif PY_MAJOR_VERSION < 3
2334 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2335 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2336 : likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\
2337 : PyObject_Format(s, f))
2338 : #elif CYTHON_USE_TYPE_SLOTS
2339 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2340 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2341 : likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
2342 : likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
2343 : PyObject_Format(s, f))
2344 : #else
2345 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2346 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2347 : PyObject_Format(s, f))
2348 : #endif
2349 :
2350 : CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2351 : static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2352 : /* GetAttr.proto */
2353 : static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2354 :
2355 : /* GetItemInt.proto */
2356 : #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2357 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2358 : __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
2359 : (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
2360 : __Pyx_GetItemInt_Generic(o, to_py_func(i))))
2361 : #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2362 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2363 : __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2364 : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2365 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2366 : int wraparound, int boundscheck);
2367 : #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2368 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2369 : __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2370 : (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2371 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2372 : int wraparound, int boundscheck);
2373 : static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2374 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2375 : int is_list, int wraparound, int boundscheck);
2376 :
2377 : /* PyObjectCallOneArg.proto */
2378 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2379 :
2380 : /* ObjectGetItem.proto */
2381 : #if CYTHON_USE_TYPE_SLOTS
2382 : static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
2383 : #else
2384 : #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2385 : #endif
2386 :
2387 : /* KeywordStringCheck.proto */
2388 : static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed);
2389 :
2390 : /* DivInt[Py_ssize_t].proto */
2391 : static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
2392 :
2393 : /* UnaryNegOverflows.proto */
2394 : #define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x)\
2395 : (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2396 :
2397 : /* GetAttr3.proto */
2398 : static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2399 :
2400 : /* PyDictVersioning.proto */
2401 : #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2402 : #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2403 : #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2404 : #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2405 : (version_var) = __PYX_GET_DICT_VERSION(dict);\
2406 : (cache_var) = (value);
2407 : #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2408 : static PY_UINT64_T __pyx_dict_version = 0;\
2409 : static PyObject *__pyx_dict_cached_value = NULL;\
2410 : if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2411 : (VAR) = __pyx_dict_cached_value;\
2412 : } else {\
2413 : (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2414 : __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2415 : }\
2416 : }
2417 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2418 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2419 : static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2420 : #else
2421 : #define __PYX_GET_DICT_VERSION(dict) (0)
2422 : #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2423 : #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2424 : #endif
2425 :
2426 : /* GetModuleGlobalName.proto */
2427 : #if CYTHON_USE_DICT_VERSIONS
2428 : #define __Pyx_GetModuleGlobalName(var, name) do {\
2429 : static PY_UINT64_T __pyx_dict_version = 0;\
2430 : static PyObject *__pyx_dict_cached_value = NULL;\
2431 : (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
2432 : (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2433 : __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2434 : } while(0)
2435 : #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
2436 : PY_UINT64_T __pyx_dict_version;\
2437 : PyObject *__pyx_dict_cached_value;\
2438 : (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2439 : } while(0)
2440 : static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2441 : #else
2442 : #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2443 : #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2444 : static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2445 : #endif
2446 :
2447 : /* AssertionsEnabled.proto */
2448 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
2449 : #define __Pyx_init_assertions_enabled() (0)
2450 : #define __pyx_assertions_enabled() (1)
2451 : #elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000)
2452 : static int __pyx_assertions_enabled_flag;
2453 : #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2454 3 : static int __Pyx_init_assertions_enabled(void) {
2455 3 : PyObject *builtins, *debug, *debug_str;
2456 3 : int flag;
2457 3 : builtins = PyEval_GetBuiltins();
2458 3 : if (!builtins) goto bad;
2459 3 : debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
2460 3 : if (!debug_str) goto bad;
2461 3 : debug = PyObject_GetItem(builtins, debug_str);
2462 3 : Py_DECREF(debug_str);
2463 3 : if (!debug) goto bad;
2464 3 : flag = PyObject_IsTrue(debug);
2465 3 : Py_DECREF(debug);
2466 3 : if (flag == -1) goto bad;
2467 3 : __pyx_assertions_enabled_flag = flag;
2468 3 : return 0;
2469 0 : bad:
2470 0 : __pyx_assertions_enabled_flag = 1;
2471 0 : return -1;
2472 : }
2473 : #else
2474 : #define __Pyx_init_assertions_enabled() (0)
2475 : #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2476 : #endif
2477 :
2478 : /* RaiseTooManyValuesToUnpack.proto */
2479 : static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2480 :
2481 : /* RaiseNeedMoreValuesToUnpack.proto */
2482 : static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2483 :
2484 : /* RaiseNoneIterError.proto */
2485 : static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2486 :
2487 : /* ExtTypeTest.proto */
2488 : static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2489 :
2490 : /* GetTopmostException.proto */
2491 : #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
2492 : static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2493 : #endif
2494 :
2495 : /* SaveResetException.proto */
2496 : #if CYTHON_FAST_THREAD_STATE
2497 : #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2498 : static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2499 : #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2500 : static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2501 : #else
2502 : #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2503 : #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2504 : #endif
2505 :
2506 : /* GetException.proto */
2507 : #if CYTHON_FAST_THREAD_STATE
2508 : #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2509 : static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2510 : #else
2511 : static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2512 : #endif
2513 :
2514 : /* SwapException.proto */
2515 : #if CYTHON_FAST_THREAD_STATE
2516 : #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2517 : static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2518 : #else
2519 : static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2520 : #endif
2521 :
2522 : /* Import.proto */
2523 : static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2524 :
2525 : /* ImportDottedModule.proto */
2526 : static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
2527 : #if PY_MAJOR_VERSION >= 3
2528 : static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple);
2529 : #endif
2530 :
2531 : /* FastTypeChecks.proto */
2532 : #if CYTHON_COMPILING_IN_CPYTHON
2533 : #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2534 : #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
2535 : static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2536 : static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
2537 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2538 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2539 : #else
2540 : #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2541 : #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
2542 : #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2543 : #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2544 : #endif
2545 : #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
2546 : #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2547 :
2548 : CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2549 : /* ListCompAppend.proto */
2550 : #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2551 0 : static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2552 0 : PyListObject* L = (PyListObject*) list;
2553 0 : Py_ssize_t len = Py_SIZE(list);
2554 0 : if (likely(L->allocated > len)) {
2555 0 : Py_INCREF(x);
2556 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
2557 : L->ob_item[len] = x;
2558 : #else
2559 0 : PyList_SET_ITEM(list, len, x);
2560 : #endif
2561 0 : __Pyx_SET_SIZE(list, len + 1);
2562 0 : return 0;
2563 : }
2564 0 : return PyList_Append(list, x);
2565 : }
2566 : #else
2567 : #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2568 : #endif
2569 :
2570 : /* PySequenceMultiply.proto */
2571 : #define __Pyx_PySequence_Multiply_Left(mul, seq) __Pyx_PySequence_Multiply(seq, mul)
2572 : static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul);
2573 :
2574 : /* SetItemInt.proto */
2575 : #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2576 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2577 : __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
2578 : (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
2579 : __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
2580 : static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
2581 : static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
2582 : int is_list, int wraparound, int boundscheck);
2583 :
2584 : /* RaiseUnboundLocalError.proto */
2585 : static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2586 :
2587 : /* DivInt[long].proto */
2588 : static CYTHON_INLINE long __Pyx_div_long(long, long);
2589 :
2590 : /* PySequenceContains.proto */
2591 0 : static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
2592 0 : int result = PySequence_Contains(seq, item);
2593 0 : return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2594 : }
2595 :
2596 : /* ImportFrom.proto */
2597 : static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2598 :
2599 : /* HasAttr.proto */
2600 : static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2601 :
2602 : /* IsLittleEndian.proto */
2603 : static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2604 :
2605 : /* BufferFormatCheck.proto */
2606 : static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2607 : static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2608 : __Pyx_BufFmt_StackElem* stack,
2609 : __Pyx_TypeInfo* type);
2610 :
2611 : /* BufferGetAndValidate.proto */
2612 : #define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
2613 : ((obj == Py_None || obj == NULL) ?\
2614 : (__Pyx_ZeroBuffer(buf), 0) :\
2615 : __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
2616 : static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
2617 : __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
2618 : static void __Pyx_ZeroBuffer(Py_buffer* buf);
2619 : static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
2620 : static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
2621 : static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
2622 :
2623 : /* BufferIndexError.proto */
2624 : static void __Pyx_RaiseBufferIndexError(int axis);
2625 :
2626 : #define __Pyx_BufPtrCContig1d(type, buf, i0, s0) ((type)buf + i0)
2627 : #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
2628 : /* PyDictContains.proto */
2629 0 : static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) {
2630 0 : int result = PyDict_Contains(dict, item);
2631 0 : return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2632 : }
2633 :
2634 : /* DictGetItem.proto */
2635 : #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
2636 : static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
2637 : #define __Pyx_PyObject_Dict_GetItem(obj, name)\
2638 : (likely(PyDict_CheckExact(obj)) ?\
2639 : __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
2640 : #else
2641 : #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
2642 : #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
2643 : #endif
2644 :
2645 : /* UnicodeAsUCS4.proto */
2646 : static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*);
2647 :
2648 : /* object_ord.proto */
2649 : #if PY_MAJOR_VERSION >= 3
2650 : #define __Pyx_PyObject_Ord(c)\
2651 : (likely(PyUnicode_Check(c)) ? (long)__Pyx_PyUnicode_AsPy_UCS4(c) : __Pyx__PyObject_Ord(c))
2652 : #else
2653 : #define __Pyx_PyObject_Ord(c) __Pyx__PyObject_Ord(c)
2654 : #endif
2655 : static long __Pyx__PyObject_Ord(PyObject* c);
2656 :
2657 : /* memoryview_get_from_buffer.proto */
2658 : #if !CYTHON_COMPILING_IN_LIMITED_API || CYTHON_LIMITED_API >= 0x030b0000
2659 : #define __Pyx_PyMemoryView_Get_itemsize(o) PyMemoryView_GET_BUFFER(o)->itemsize
2660 : #else
2661 : // can't get format like this unfortunately. It's unicode via getattr
2662 : static Py_ssize_t __Pyx_PyMemoryView_Get_itemsize(PyObject *obj);
2663 : #endif
2664 :
2665 : /* memoryview_get_from_buffer.proto */
2666 : #if !CYTHON_COMPILING_IN_LIMITED_API || CYTHON_LIMITED_API >= 0x030b0000
2667 : #define __Pyx_PyMemoryView_Get_ndim(o) PyMemoryView_GET_BUFFER(o)->ndim
2668 : #else
2669 : // can't get format like this unfortunately. It's unicode via getattr
2670 : static int __Pyx_PyMemoryView_Get_ndim(PyObject *obj);
2671 : #endif
2672 :
2673 : /* IterFinish.proto */
2674 : static CYTHON_INLINE int __Pyx_IterFinish(void);
2675 :
2676 : /* PyObjectCallNoArg.proto */
2677 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
2678 :
2679 : /* PyObjectGetMethod.proto */
2680 : static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
2681 :
2682 : /* PyObjectCallMethod0.proto */
2683 : static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
2684 :
2685 : /* UnpackItemEndCheck.proto */
2686 : static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
2687 :
2688 : /* UnpackTupleError.proto */
2689 : static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
2690 :
2691 : /* UnpackTuple2.proto */
2692 : #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
2693 : (likely(is_tuple || PyTuple_Check(tuple)) ?\
2694 : (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
2695 : __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
2696 : (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
2697 : __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
2698 : static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
2699 : PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
2700 : static int __Pyx_unpack_tuple2_generic(
2701 : PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);
2702 :
2703 : /* dict_iter.proto */
2704 : static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
2705 : Py_ssize_t* p_orig_length, int* p_is_dict);
2706 : static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
2707 : PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);
2708 :
2709 : /* ListExtend.proto */
2710 0 : static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2711 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
2712 0 : PyObject* none = _PyList_Extend((PyListObject*)L, v);
2713 0 : if (unlikely(!none))
2714 : return -1;
2715 0 : Py_DECREF(none);
2716 : return 0;
2717 : #else
2718 : return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2719 : #endif
2720 : }
2721 :
2722 : /* py_dict_values.proto */
2723 : static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
2724 :
2725 : /* UnpackUnboundCMethod.proto */
2726 : typedef struct {
2727 : PyObject *type;
2728 : PyObject **method_name;
2729 : PyCFunction func;
2730 : PyObject *method;
2731 : int flag;
2732 : } __Pyx_CachedCFunction;
2733 :
2734 : /* CallUnboundCMethod0.proto */
2735 : static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2736 : #if CYTHON_COMPILING_IN_CPYTHON
2737 : #define __Pyx_CallUnboundCMethod0(cfunc, self)\
2738 : (likely((cfunc)->func) ?\
2739 : (likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\
2740 : (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\
2741 : (PY_VERSION_HEX >= 0x030700A0 ?\
2742 : (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\
2743 : (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\
2744 : (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\
2745 : (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\
2746 : (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\
2747 : ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) :\
2748 : __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\
2749 : __Pyx__CallUnboundCMethod0(cfunc, self))
2750 : #else
2751 : #define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
2752 : #endif
2753 :
2754 : /* dict_getitem_default.proto */
2755 : static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);
2756 :
2757 : /* CallUnboundCMethod1.proto */
2758 : static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
2759 : #if CYTHON_COMPILING_IN_CPYTHON
2760 : static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
2761 : #else
2762 : #define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg)
2763 : #endif
2764 :
2765 : /* CallUnboundCMethod2.proto */
2766 : static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
2767 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
2768 : static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
2769 : #else
2770 : #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
2771 : #endif
2772 :
2773 : /* ListAppend.proto */
2774 : #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2775 3 : static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2776 3 : PyListObject* L = (PyListObject*) list;
2777 3 : Py_ssize_t len = Py_SIZE(list);
2778 3 : if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2779 0 : Py_INCREF(x);
2780 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
2781 : L->ob_item[len] = x;
2782 : #else
2783 0 : PyList_SET_ITEM(list, len, x);
2784 : #endif
2785 0 : __Pyx_SET_SIZE(list, len + 1);
2786 0 : return 0;
2787 : }
2788 3 : return PyList_Append(list, x);
2789 : }
2790 : #else
2791 : #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2792 : #endif
2793 :
2794 : /* PyObject_GenericGetAttrNoDict.proto */
2795 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2796 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2797 : #else
2798 : #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2799 : #endif
2800 :
2801 : /* PyObject_GenericGetAttr.proto */
2802 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2803 : static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2804 : #else
2805 : #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2806 : #endif
2807 :
2808 : /* IncludeStructmemberH.proto */
2809 : #include <structmember.h>
2810 :
2811 : /* FixUpExtensionType.proto */
2812 : #if CYTHON_USE_TYPE_SPECS
2813 : static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
2814 : #endif
2815 :
2816 : /* ValidateBasesTuple.proto */
2817 : #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
2818 : static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
2819 : #endif
2820 :
2821 : /* PyType_Ready.proto */
2822 : CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);
2823 :
2824 : /* SetVTable.proto */
2825 : static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);
2826 :
2827 : /* GetVTable.proto */
2828 : static void* __Pyx_GetVtable(PyTypeObject *type);
2829 :
2830 : /* MergeVTables.proto */
2831 : #if !CYTHON_COMPILING_IN_LIMITED_API
2832 : static int __Pyx_MergeVtables(PyTypeObject *type);
2833 : #endif
2834 :
2835 : /* SetupReduce.proto */
2836 : #if !CYTHON_COMPILING_IN_LIMITED_API
2837 : static int __Pyx_setup_reduce(PyObject* type_obj);
2838 : #endif
2839 :
2840 : /* TypeImport.proto */
2841 : #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_11
2842 : #define __PYX_HAVE_RT_ImportType_proto_3_0_11
2843 : #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
2844 : #include <stdalign.h>
2845 : #endif
2846 : #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
2847 : #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) alignof(s)
2848 : #else
2849 : #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) sizeof(void*)
2850 : #endif
2851 : enum __Pyx_ImportType_CheckSize_3_0_11 {
2852 : __Pyx_ImportType_CheckSize_Error_3_0_11 = 0,
2853 : __Pyx_ImportType_CheckSize_Warn_3_0_11 = 1,
2854 : __Pyx_ImportType_CheckSize_Ignore_3_0_11 = 2
2855 : };
2856 : static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size);
2857 : #endif
2858 :
2859 : /* FetchSharedCythonModule.proto */
2860 : static PyObject *__Pyx_FetchSharedCythonABIModule(void);
2861 :
2862 : /* FetchCommonType.proto */
2863 : #if !CYTHON_USE_TYPE_SPECS
2864 : static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2865 : #else
2866 : static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
2867 : #endif
2868 :
2869 : /* PyMethodNew.proto */
2870 : #if CYTHON_COMPILING_IN_LIMITED_API
2871 : static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
2872 : PyObject *typesModule=NULL, *methodType=NULL, *result=NULL;
2873 : CYTHON_UNUSED_VAR(typ);
2874 : if (!self)
2875 : return __Pyx_NewRef(func);
2876 : typesModule = PyImport_ImportModule("types");
2877 : if (!typesModule) return NULL;
2878 : methodType = PyObject_GetAttrString(typesModule, "MethodType");
2879 : Py_DECREF(typesModule);
2880 : if (!methodType) return NULL;
2881 : result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL);
2882 : Py_DECREF(methodType);
2883 : return result;
2884 : }
2885 : #elif PY_MAJOR_VERSION >= 3
2886 0 : static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
2887 0 : CYTHON_UNUSED_VAR(typ);
2888 0 : if (!self)
2889 0 : return __Pyx_NewRef(func);
2890 0 : return PyMethod_New(func, self);
2891 : }
2892 : #else
2893 : #define __Pyx_PyMethod_New PyMethod_New
2894 : #endif
2895 :
2896 : /* PyVectorcallFastCallDict.proto */
2897 : #if CYTHON_METH_FASTCALL
2898 : static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
2899 : #endif
2900 :
2901 : /* CythonFunctionShared.proto */
2902 : #define __Pyx_CyFunction_USED
2903 : #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2904 : #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2905 : #define __Pyx_CYFUNCTION_CCLASS 0x04
2906 : #define __Pyx_CYFUNCTION_COROUTINE 0x08
2907 : #define __Pyx_CyFunction_GetClosure(f)\
2908 : (((__pyx_CyFunctionObject *) (f))->func_closure)
2909 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
2910 : #define __Pyx_CyFunction_GetClassObj(f)\
2911 : (((__pyx_CyFunctionObject *) (f))->func_classobj)
2912 : #else
2913 : #define __Pyx_CyFunction_GetClassObj(f)\
2914 : ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
2915 : #endif
2916 : #define __Pyx_CyFunction_SetClassObj(f, classobj)\
2917 : __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
2918 : #define __Pyx_CyFunction_Defaults(type, f)\
2919 : ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2920 : #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2921 : ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2922 : typedef struct {
2923 : #if CYTHON_COMPILING_IN_LIMITED_API
2924 : PyObject_HEAD
2925 : PyObject *func;
2926 : #elif PY_VERSION_HEX < 0x030900B1
2927 : PyCFunctionObject func;
2928 : #else
2929 : PyCMethodObject func;
2930 : #endif
2931 : #if CYTHON_BACKPORT_VECTORCALL
2932 : __pyx_vectorcallfunc func_vectorcall;
2933 : #endif
2934 : #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
2935 : PyObject *func_weakreflist;
2936 : #endif
2937 : PyObject *func_dict;
2938 : PyObject *func_name;
2939 : PyObject *func_qualname;
2940 : PyObject *func_doc;
2941 : PyObject *func_globals;
2942 : PyObject *func_code;
2943 : PyObject *func_closure;
2944 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
2945 : PyObject *func_classobj;
2946 : #endif
2947 : void *defaults;
2948 : int defaults_pyobjects;
2949 : size_t defaults_size;
2950 : int flags;
2951 : PyObject *defaults_tuple;
2952 : PyObject *defaults_kwdict;
2953 : PyObject *(*defaults_getter)(PyObject *);
2954 : PyObject *func_annotations;
2955 : PyObject *func_is_coroutine;
2956 : } __pyx_CyFunctionObject;
2957 : #undef __Pyx_CyOrPyCFunction_Check
2958 : #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType)
2959 : #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type)
2960 : #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType)
2961 : static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc);
2962 : #undef __Pyx_IsSameCFunction
2963 : #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
2964 : static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2965 : int flags, PyObject* qualname,
2966 : PyObject *closure,
2967 : PyObject *module, PyObject *globals,
2968 : PyObject* code);
2969 : static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
2970 : static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2971 : size_t size,
2972 : int pyobjects);
2973 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2974 : PyObject *tuple);
2975 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2976 : PyObject *dict);
2977 : static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2978 : PyObject *dict);
2979 : static int __pyx_CyFunction_init(PyObject *module);
2980 : #if CYTHON_METH_FASTCALL
2981 : static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2982 : static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2983 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2984 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2985 : #if CYTHON_BACKPORT_VECTORCALL
2986 : #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
2987 : #else
2988 : #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
2989 : #endif
2990 : #endif
2991 :
2992 : /* CythonFunction.proto */
2993 : static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2994 : int flags, PyObject* qualname,
2995 : PyObject *closure,
2996 : PyObject *module, PyObject *globals,
2997 : PyObject* code);
2998 :
2999 : /* FusedFunction.proto */
3000 : typedef struct {
3001 : __pyx_CyFunctionObject func;
3002 : PyObject *__signatures__;
3003 : PyObject *self;
3004 : } __pyx_FusedFunctionObject;
3005 : static PyObject *__pyx_FusedFunction_New(PyMethodDef *ml, int flags,
3006 : PyObject *qualname, PyObject *closure,
3007 : PyObject *module, PyObject *globals,
3008 : PyObject *code);
3009 : static int __pyx_FusedFunction_clear(__pyx_FusedFunctionObject *self);
3010 : static int __pyx_FusedFunction_init(PyObject *module);
3011 : #define __Pyx_FusedFunction_USED
3012 :
3013 : /* CLineInTraceback.proto */
3014 : #ifdef CYTHON_CLINE_IN_TRACEBACK
3015 : #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
3016 : #else
3017 : static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
3018 : #endif
3019 :
3020 : /* CodeObjectCache.proto */
3021 : #if !CYTHON_COMPILING_IN_LIMITED_API
3022 : typedef struct {
3023 : PyCodeObject* code_object;
3024 : int code_line;
3025 : } __Pyx_CodeObjectCacheEntry;
3026 : struct __Pyx_CodeObjectCache {
3027 : int count;
3028 : int max_count;
3029 : __Pyx_CodeObjectCacheEntry* entries;
3030 : };
3031 : static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
3032 : static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
3033 : static PyCodeObject *__pyx_find_code_object(int code_line);
3034 : static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
3035 : #endif
3036 :
3037 : /* AddTraceback.proto */
3038 : static void __Pyx_AddTraceback(const char *funcname, int c_line,
3039 : int py_line, const char *filename);
3040 :
3041 : #if PY_MAJOR_VERSION < 3
3042 : static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
3043 : static void __Pyx_ReleaseBuffer(Py_buffer *view);
3044 : #else
3045 : #define __Pyx_GetBuffer PyObject_GetBuffer
3046 : #define __Pyx_ReleaseBuffer PyBuffer_Release
3047 : #endif
3048 :
3049 :
3050 : /* BufferStructDeclare.proto */
3051 : typedef struct {
3052 : Py_ssize_t shape, strides, suboffsets;
3053 : } __Pyx_Buf_DimInfo;
3054 : typedef struct {
3055 : size_t refcount;
3056 : Py_buffer pybuffer;
3057 : } __Pyx_Buffer;
3058 : typedef struct {
3059 : __Pyx_Buffer *rcbuffer;
3060 : char *data;
3061 : __Pyx_Buf_DimInfo diminfo[8];
3062 : } __Pyx_LocalBuf_ND;
3063 :
3064 : /* MemviewSliceIsContig.proto */
3065 : static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
3066 :
3067 : /* OverlappingSlices.proto */
3068 : static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
3069 : __Pyx_memviewslice *slice2,
3070 : int ndim, size_t itemsize);
3071 :
3072 : /* TypeInfoCompare.proto */
3073 : static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
3074 :
3075 : /* MemviewSliceValidateAndInit.proto */
3076 : static int __Pyx_ValidateAndInit_memviewslice(
3077 : int *axes_specs,
3078 : int c_or_f_flag,
3079 : int buf_flags,
3080 : int ndim,
3081 : __Pyx_TypeInfo *dtype,
3082 : __Pyx_BufFmt_StackElem stack[],
3083 : __Pyx_memviewslice *memviewslice,
3084 : PyObject *original_obj);
3085 :
3086 : /* ObjectToMemviewSlice.proto */
3087 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *, int writable_flag);
3088 :
3089 : /* ObjectToMemviewSlice.proto */
3090 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *, int writable_flag);
3091 :
3092 : /* PyUCS4InUnicode.proto */
3093 : static CYTHON_INLINE int __Pyx_UnicodeContainsUCS4(PyObject* unicode, Py_UCS4 character);
3094 :
3095 : /* RealImag.proto */
3096 : #if CYTHON_CCOMPLEX
3097 : #ifdef __cplusplus
3098 : #define __Pyx_CREAL(z) ((z).real())
3099 : #define __Pyx_CIMAG(z) ((z).imag())
3100 : #else
3101 : #define __Pyx_CREAL(z) (__real__(z))
3102 : #define __Pyx_CIMAG(z) (__imag__(z))
3103 : #endif
3104 : #else
3105 : #define __Pyx_CREAL(z) ((z).real)
3106 : #define __Pyx_CIMAG(z) ((z).imag)
3107 : #endif
3108 : #if defined(__cplusplus) && CYTHON_CCOMPLEX\
3109 : && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
3110 : #define __Pyx_SET_CREAL(z,x) ((z).real(x))
3111 : #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
3112 : #else
3113 : #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
3114 : #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
3115 : #endif
3116 :
3117 : /* Arithmetic.proto */
3118 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3119 : #define __Pyx_c_eq_float(a, b) ((a)==(b))
3120 : #define __Pyx_c_sum_float(a, b) ((a)+(b))
3121 : #define __Pyx_c_diff_float(a, b) ((a)-(b))
3122 : #define __Pyx_c_prod_float(a, b) ((a)*(b))
3123 : #define __Pyx_c_quot_float(a, b) ((a)/(b))
3124 : #define __Pyx_c_neg_float(a) (-(a))
3125 : #ifdef __cplusplus
3126 : #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
3127 : #define __Pyx_c_conj_float(z) (::std::conj(z))
3128 : #if 1
3129 : #define __Pyx_c_abs_float(z) (::std::abs(z))
3130 : #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
3131 : #endif
3132 : #else
3133 : #define __Pyx_c_is_zero_float(z) ((z)==0)
3134 : #define __Pyx_c_conj_float(z) (conjf(z))
3135 : #if 1
3136 : #define __Pyx_c_abs_float(z) (cabsf(z))
3137 : #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
3138 : #endif
3139 : #endif
3140 : #else
3141 : static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
3142 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
3143 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
3144 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
3145 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
3146 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
3147 : static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
3148 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
3149 : #if 1
3150 : static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
3151 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
3152 : #endif
3153 : #endif
3154 :
3155 : /* Arithmetic.proto */
3156 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3157 : #define __Pyx_c_eq_double(a, b) ((a)==(b))
3158 : #define __Pyx_c_sum_double(a, b) ((a)+(b))
3159 : #define __Pyx_c_diff_double(a, b) ((a)-(b))
3160 : #define __Pyx_c_prod_double(a, b) ((a)*(b))
3161 : #define __Pyx_c_quot_double(a, b) ((a)/(b))
3162 : #define __Pyx_c_neg_double(a) (-(a))
3163 : #ifdef __cplusplus
3164 : #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
3165 : #define __Pyx_c_conj_double(z) (::std::conj(z))
3166 : #if 1
3167 : #define __Pyx_c_abs_double(z) (::std::abs(z))
3168 : #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
3169 : #endif
3170 : #else
3171 : #define __Pyx_c_is_zero_double(z) ((z)==0)
3172 : #define __Pyx_c_conj_double(z) (conj(z))
3173 : #if 1
3174 : #define __Pyx_c_abs_double(z) (cabs(z))
3175 : #define __Pyx_c_pow_double(a, b) (cpow(a, b))
3176 : #endif
3177 : #endif
3178 : #else
3179 : static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
3180 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
3181 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
3182 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
3183 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
3184 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
3185 : static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
3186 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
3187 : #if 1
3188 : static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
3189 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
3190 : #endif
3191 : #endif
3192 :
3193 : /* Arithmetic.proto */
3194 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3195 : #define __Pyx_c_eq_long__double(a, b) ((a)==(b))
3196 : #define __Pyx_c_sum_long__double(a, b) ((a)+(b))
3197 : #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
3198 : #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
3199 : #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
3200 : #define __Pyx_c_neg_long__double(a) (-(a))
3201 : #ifdef __cplusplus
3202 : #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
3203 : #define __Pyx_c_conj_long__double(z) (::std::conj(z))
3204 : #if 1
3205 : #define __Pyx_c_abs_long__double(z) (::std::abs(z))
3206 : #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
3207 : #endif
3208 : #else
3209 : #define __Pyx_c_is_zero_long__double(z) ((z)==0)
3210 : #define __Pyx_c_conj_long__double(z) (conjl(z))
3211 : #if 1
3212 : #define __Pyx_c_abs_long__double(z) (cabsl(z))
3213 : #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
3214 : #endif
3215 : #endif
3216 : #else
3217 : static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3218 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3219 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3220 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3221 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3222 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
3223 : static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
3224 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
3225 : #if 1
3226 : static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
3227 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3228 : #endif
3229 : #endif
3230 :
3231 : /* MemviewSliceCopyTemplate.proto */
3232 : static __Pyx_memviewslice
3233 : __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
3234 : const char *mode, int ndim,
3235 : size_t sizeof_dtype, int contig_flag,
3236 : int dtype_is_object);
3237 :
3238 : /* MemviewSliceInit.proto */
3239 : #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
3240 : #define __Pyx_MEMVIEW_DIRECT 1
3241 : #define __Pyx_MEMVIEW_PTR 2
3242 : #define __Pyx_MEMVIEW_FULL 4
3243 : #define __Pyx_MEMVIEW_CONTIG 8
3244 : #define __Pyx_MEMVIEW_STRIDED 16
3245 : #define __Pyx_MEMVIEW_FOLLOW 32
3246 : #define __Pyx_IS_C_CONTIG 1
3247 : #define __Pyx_IS_F_CONTIG 2
3248 : static int __Pyx_init_memviewslice(
3249 : struct __pyx_memoryview_obj *memview,
3250 : int ndim,
3251 : __Pyx_memviewslice *memviewslice,
3252 : int memview_is_new_reference);
3253 : static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
3254 : __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3255 : static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
3256 : __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3257 : #define __pyx_get_slice_count_pointer(memview) (&memview->acquisition_count)
3258 : #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
3259 : #define __PYX_XCLEAR_MEMVIEW(slice, have_gil) __Pyx_XCLEAR_MEMVIEW(slice, have_gil, __LINE__)
3260 : static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
3261 : static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *, int, int);
3262 :
3263 : /* CIntFromPy.proto */
3264 : static CYTHON_INLINE npy_intp __Pyx_PyInt_As_npy_intp(PyObject *);
3265 :
3266 : /* CIntToPy.proto */
3267 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
3268 :
3269 : /* CIntToPy.proto */
3270 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_intp(npy_intp value);
3271 :
3272 : /* CIntToPy.proto */
3273 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value);
3274 :
3275 : /* CIntToPy.proto */
3276 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value);
3277 :
3278 : /* ImportNumPyArray.proto */
3279 : static PyObject *__pyx_numpy_ndarray = NULL;
3280 : static PyObject* __Pyx_ImportNumPyArrayTypeIfAvailable(void);
3281 :
3282 : /* CIntFromPy.proto */
3283 : static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
3284 :
3285 : /* CIntFromPy.proto */
3286 : static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
3287 :
3288 : /* CIntToPy.proto */
3289 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
3290 :
3291 : /* CIntFromPy.proto */
3292 : static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
3293 :
3294 : /* FormatTypeName.proto */
3295 : #if CYTHON_COMPILING_IN_LIMITED_API
3296 : typedef PyObject *__Pyx_TypeName;
3297 : #define __Pyx_FMT_TYPENAME "%U"
3298 : static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
3299 : #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
3300 : #else
3301 : typedef const char *__Pyx_TypeName;
3302 : #define __Pyx_FMT_TYPENAME "%.200s"
3303 : #define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
3304 : #define __Pyx_DECREF_TypeName(obj)
3305 : #endif
3306 :
3307 : /* CheckBinaryVersion.proto */
3308 : static unsigned long __Pyx_get_runtime_version(void);
3309 : static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
3310 :
3311 : /* InitStrings.proto */
3312 : static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
3313 :
3314 : /* #### Code section: module_declarations ### */
3315 : static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
3316 : static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
3317 : static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
3318 : static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
3319 : static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
3320 : static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
3321 : static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3322 : static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3323 : static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self); /* proto*/
3324 : static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3325 : static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3326 : static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto*/
3327 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self); /* proto*/
3328 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self); /* proto*/
3329 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self); /* proto*/
3330 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self); /* proto*/
3331 : static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self); /* proto*/
3332 : static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self); /* proto*/
3333 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3334 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3335 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3336 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3337 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3338 : static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3339 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self); /* proto*/
3340 : static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self); /* proto*/
3341 : static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self); /* proto*/
3342 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self); /* proto*/
3343 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self); /* proto*/
3344 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/
3345 : static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/
3346 :
3347 : /* Module declarations from "libc.string" */
3348 :
3349 : /* Module declarations from "libc.stdio" */
3350 :
3351 : /* Module declarations from "__builtin__" */
3352 :
3353 : /* Module declarations from "cpython.type" */
3354 :
3355 : /* Module declarations from "cpython" */
3356 :
3357 : /* Module declarations from "cpython.object" */
3358 :
3359 : /* Module declarations from "cpython.ref" */
3360 :
3361 : /* Module declarations from "numpy" */
3362 :
3363 : /* Module declarations from "numpy" */
3364 : static CYTHON_INLINE int __pyx_f_5numpy_import_array(void); /*proto*/
3365 :
3366 : /* Module declarations from "scipy.sparse.csgraph._reordering" */
3367 : static PyObject *__pyx_collections_abc_Sequence = 0;
3368 : static PyObject *generic = 0;
3369 : static PyObject *strided = 0;
3370 : static PyObject *indirect = 0;
3371 : static PyObject *contiguous = 0;
3372 : static PyObject *indirect_contiguous = 0;
3373 : static int __pyx_memoryview_thread_locks_used;
3374 : static PyThread_type_lock __pyx_memoryview_thread_locks[8];
3375 : static PyObject *__pyx_fuse_0__pyx_f_5scipy_6sparse_7csgraph_11_reordering__node_degrees(PyArrayObject *, PyArrayObject *, npy_intp); /*proto*/
3376 : static PyObject *__pyx_fuse_1__pyx_f_5scipy_6sparse_7csgraph_11_reordering__node_degrees(PyArrayObject *, PyArrayObject *, npy_intp); /*proto*/
3377 : static int __pyx_array_allocate_buffer(struct __pyx_array_obj *); /*proto*/
3378 : static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
3379 : static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
3380 : static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
3381 : static PyObject *_unellipsify(PyObject *, int); /*proto*/
3382 : static int assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
3383 : static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
3384 : static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
3385 : static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
3386 : static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
3387 : static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
3388 : static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3389 : static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3390 : static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
3391 : static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3392 : static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
3393 : static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
3394 : static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
3395 : static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
3396 : static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
3397 : static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
3398 : static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
3399 : static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
3400 : static int __pyx_memoryview_err_dim(PyObject *, PyObject *, int); /*proto*/
3401 : static int __pyx_memoryview_err(PyObject *, PyObject *); /*proto*/
3402 : static int __pyx_memoryview_err_no_memory(void); /*proto*/
3403 : static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
3404 : static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
3405 : static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
3406 : static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3407 : static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3408 : static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
3409 : static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
3410 : static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
3411 : /* #### Code section: typeinfo ### */
3412 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', __PYX_IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 };
3413 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', __PYX_IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 };
3414 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn_npy_intp = { "npy_intp", NULL, sizeof(npy_intp), { 0 }, 0, __PYX_IS_UNSIGNED(npy_intp) ? 'U' : 'I', __PYX_IS_UNSIGNED(npy_intp), 0 };
3415 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5scipy_6sparse_7csgraph_11_reordering_ITYPE_t = { "ITYPE_t", NULL, sizeof(__pyx_t_5scipy_6sparse_7csgraph_11_reordering_ITYPE_t), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_5scipy_6sparse_7csgraph_11_reordering_ITYPE_t) ? 'U' : 'I', __PYX_IS_UNSIGNED(__pyx_t_5scipy_6sparse_7csgraph_11_reordering_ITYPE_t), 0 };
3416 : /* #### Code section: before_global_var ### */
3417 : #define __Pyx_MODULE_NAME "scipy.sparse.csgraph._reordering"
3418 : extern int __pyx_module_is_main_scipy__sparse__csgraph___reordering;
3419 : int __pyx_module_is_main_scipy__sparse__csgraph___reordering = 0;
3420 :
3421 : /* Implementation of "scipy.sparse.csgraph._reordering" */
3422 : /* #### Code section: global_var ### */
3423 : static PyObject *__pyx_builtin_TypeError;
3424 : static PyObject *__pyx_builtin_range;
3425 : static PyObject *__pyx_builtin_ValueError;
3426 : static PyObject *__pyx_builtin___import__;
3427 : static PyObject *__pyx_builtin_MemoryError;
3428 : static PyObject *__pyx_builtin_enumerate;
3429 : static PyObject *__pyx_builtin_AssertionError;
3430 : static PyObject *__pyx_builtin_Ellipsis;
3431 : static PyObject *__pyx_builtin_id;
3432 : static PyObject *__pyx_builtin_IndexError;
3433 : static PyObject *__pyx_builtin_ImportError;
3434 : /* #### Code section: string_decls ### */
3435 : static const char __pyx_k_[] = ": ";
3436 : static const char __pyx_k_N[] = "N";
3437 : static const char __pyx_k_O[] = "O";
3438 : static const char __pyx_k_T[] = "T";
3439 : static const char __pyx_k_c[] = "c";
3440 : static const char __pyx_k_i[] = "i";
3441 : static const char __pyx_k_j[] = "j";
3442 : static const char __pyx_k_s[] = "s";
3443 : static const char __pyx_k__2[] = ".";
3444 : static const char __pyx_k__3[] = "*";
3445 : static const char __pyx_k__6[] = "'";
3446 : static const char __pyx_k__7[] = ")";
3447 : static const char __pyx_k_gc[] = "gc";
3448 : static const char __pyx_k_id[] = "id";
3449 : static const char __pyx_k_ii[] = "ii";
3450 : static const char __pyx_k_jj[] = "jj";
3451 : static const char __pyx_k_kk[] = "kk";
3452 : static const char __pyx_k_ll[] = "ll";
3453 : static const char __pyx_k_np[] = "np";
3454 : static const char __pyx_k_zz[] = "zz";
3455 : static const char __pyx_k__13[] = "()";
3456 : static const char __pyx_k__14[] = "|";
3457 : static const char __pyx_k__30[] = "";
3458 : static const char __pyx_k__38[] = "?";
3459 : static const char __pyx_k_abc[] = "abc";
3460 : static const char __pyx_k_and[] = " and ";
3461 : static const char __pyx_k_coo[] = "coo";
3462 : static const char __pyx_k_csc[] = "csc";
3463 : static const char __pyx_k_csr[] = "csr";
3464 : static const char __pyx_k_get[] = "get";
3465 : static const char __pyx_k_got[] = " (got ";
3466 : static const char __pyx_k_ind[] = "ind";
3467 : static const char __pyx_k_max[] = "max";
3468 : static const char __pyx_k_new[] = "__new__";
3469 : static const char __pyx_k_obj[] = "obj";
3470 : static const char __pyx_k_ptr[] = "ptr";
3471 : static const char __pyx_k_sum[] = "sum";
3472 : static const char __pyx_k_sys[] = "sys";
3473 : static const char __pyx_k_args[] = "args";
3474 : static const char __pyx_k_base[] = "base";
3475 : static const char __pyx_k_dict[] = "__dict__";
3476 : static const char __pyx_k_inds[] = "inds";
3477 : static const char __pyx_k_kind[] = "kind";
3478 : static const char __pyx_k_main[] = "__main__";
3479 : static const char __pyx_k_mode[] = "mode";
3480 : static const char __pyx_k_name[] = "name";
3481 : static const char __pyx_k_ndim[] = "ndim";
3482 : static const char __pyx_k_pack[] = "pack";
3483 : static const char __pyx_k_rank[] = "rank";
3484 : static const char __pyx_k_seed[] = "seed";
3485 : static const char __pyx_k_size[] = "size";
3486 : static const char __pyx_k_spec[] = "__spec__";
3487 : static const char __pyx_k_step[] = "step";
3488 : static const char __pyx_k_stop[] = "stop";
3489 : static const char __pyx_k_temp[] = "temp";
3490 : static const char __pyx_k_test[] = "__test__";
3491 : static const char __pyx_k_warn[] = "warn";
3492 : static const char __pyx_k_ASCII[] = "ASCII";
3493 : static const char __pyx_k_DTYPE[] = "DTYPE";
3494 : static const char __pyx_k_ITYPE[] = "ITYPE";
3495 : static const char __pyx_k_N_old[] = "N_old";
3496 : static const char __pyx_k_class[] = "__class__";
3497 : static const char __pyx_k_count[] = "count";
3498 : static const char __pyx_k_dtype[] = "dtype";
3499 : static const char __pyx_k_error[] = "error";
3500 : static const char __pyx_k_flags[] = "flags";
3501 : static const char __pyx_k_graph[] = "graph";
3502 : static const char __pyx_k_index[] = "index";
3503 : static const char __pyx_k_int32[] = "int32";
3504 : static const char __pyx_k_nrows[] = "nrows";
3505 : static const char __pyx_k_numpy[] = "numpy";
3506 : static const char __pyx_k_order[] = "order";
3507 : static const char __pyx_k_range[] = "range";
3508 : static const char __pyx_k_shape[] = "shape";
3509 : static const char __pyx_k_split[] = "split";
3510 : static const char __pyx_k_start[] = "start";
3511 : static const char __pyx_k_strip[] = "strip";
3512 : static const char __pyx_k_temp2[] = "temp2";
3513 : static const char __pyx_k_tocsr[] = "tocsr";
3514 : static const char __pyx_k_zeros[] = "zeros";
3515 : static const char __pyx_k_degree[] = "degree";
3516 : static const char __pyx_k_enable[] = "enable";
3517 : static const char __pyx_k_encode[] = "encode";
3518 : static const char __pyx_k_format[] = "format";
3519 : static const char __pyx_k_import[] = "__import__";
3520 : static const char __pyx_k_indptr[] = "indptr";
3521 : static const char __pyx_k_kwargs[] = "kwargs";
3522 : static const char __pyx_k_name_2[] = "__name__";
3523 : static const char __pyx_k_pickle[] = "pickle";
3524 : static const char __pyx_k_reduce[] = "__reduce__";
3525 : static const char __pyx_k_struct[] = "struct";
3526 : static const char __pyx_k_unpack[] = "unpack";
3527 : static const char __pyx_k_update[] = "update";
3528 : static const char __pyx_k_values[] = "values";
3529 : static const char __pyx_k_argsort[] = "argsort";
3530 : static const char __pyx_k_disable[] = "disable";
3531 : static const char __pyx_k_float64[] = "float64";
3532 : static const char __pyx_k_fortran[] = "fortran";
3533 : static const char __pyx_k_indices[] = "indices";
3534 : static const char __pyx_k_int32_t[] = "int32_t";
3535 : static const char __pyx_k_int64_t[] = "int64_t";
3536 : static const char __pyx_k_memview[] = "memview";
3537 : static const char __pyx_k_Ellipsis[] = "Ellipsis";
3538 : static const char __pyx_k_Sequence[] = "Sequence";
3539 : static const char __pyx_k_defaults[] = "defaults";
3540 : static const char __pyx_k_getstate[] = "__getstate__";
3541 : static const char __pyx_k_issparse[] = "issparse";
3542 : static const char __pyx_k_itemsize[] = "itemsize";
3543 : static const char __pyx_k_num_rows[] = "num_rows";
3544 : static const char __pyx_k_pyx_type[] = "__pyx_type";
3545 : static const char __pyx_k_register[] = "register";
3546 : static const char __pyx_k_rev_inds[] = "rev_inds";
3547 : static const char __pyx_k_setstate[] = "__setstate__";
3548 : static const char __pyx_k_warnings[] = "warnings";
3549 : static const char __pyx_k_TypeError[] = "TypeError";
3550 : static const char __pyx_k_csr_array[] = "csr_array";
3551 : static const char __pyx_k_enumerate[] = "enumerate";
3552 : static const char __pyx_k_isenabled[] = "isenabled";
3553 : static const char __pyx_k_level_end[] = "level_end";
3554 : static const char __pyx_k_level_len[] = "level_len";
3555 : static const char __pyx_k_pyx_state[] = "__pyx_state";
3556 : static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
3557 : static const char __pyx_k_transpose[] = "transpose";
3558 : static const char __pyx_k_IndexError[] = "IndexError";
3559 : static const char __pyx_k_ValueError[] = "ValueError";
3560 : static const char __pyx_k_pyx_result[] = "__pyx_result";
3561 : static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
3562 : static const char __pyx_k_signatures[] = "signatures";
3563 : static const char __pyx_k_ImportError[] = "ImportError";
3564 : static const char __pyx_k_MemoryError[] = "MemoryError";
3565 : static const char __pyx_k_PickleError[] = "PickleError";
3566 : static const char __pyx_k_collections[] = "collections";
3567 : static const char __pyx_k_level_start[] = "level_start";
3568 : static const char __pyx_k_initializing[] = "_initializing";
3569 : static const char __pyx_k_is_coroutine[] = "_is_coroutine";
3570 : static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
3571 : static const char __pyx_k_scipy_sparse[] = "scipy.sparse";
3572 : static const char __pyx_k_stringsource[] = "<stringsource>";
3573 : static const char __pyx_k_temp_degrees[] = "temp_degrees";
3574 : static const char __pyx_k_version_info[] = "version_info";
3575 : static const char __pyx_k_class_getitem[] = "__class_getitem__";
3576 : static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
3577 : static const char __pyx_k_AssertionError[] = "AssertionError";
3578 : static const char __pyx_k_fused_sigindex[] = "_fused_sigindex";
3579 : static const char __pyx_k_symmetric_mode[] = "symmetric_mode";
3580 : static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
3581 : static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
3582 : static const char __pyx_k_collections_abc[] = "collections.abc";
3583 : static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
3584 : static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
3585 : static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
3586 : static const char __pyx_k_structural_rank[] = "structural_rank";
3587 : static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
3588 : static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
3589 : static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
3590 : static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
3591 : static const char __pyx_k_Input_must_be_sparse[] = "Input must be sparse";
3592 : static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
3593 : static const char __pyx_k_Invalid_shape_in_axis[] = "Invalid shape in axis ";
3594 : static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
3595 : static const char __pyx_k_reverse_cuthill_mckee[] = "_reverse_cuthill_mckee";
3596 : static const char __pyx_k_scipy_sparse__sputils[] = "scipy.sparse._sputils";
3597 : static const char __pyx_k_Cannot_index_with_type[] = "Cannot index with type '";
3598 : static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
3599 : static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
3600 : static const char __pyx_k_SparseEfficiencyWarning[] = "SparseEfficiencyWarning";
3601 : static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
3602 : static const char __pyx_k_reverse_cuthill_mckee_2[] = "reverse_cuthill_mckee";
3603 : static const char __pyx_k_structural_rank_line_177[] = "structural_rank (line 177)";
3604 : static const char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct";
3605 : static const char __pyx_k_Index_out_of_bounds_axis_d[] = "Index out of bounds (axis %d)";
3606 : static const char __pyx_k_Input_graph_must_be_sparse[] = "Input graph must be sparse";
3607 : static const char __pyx_k_maximum_bipartite_matching[] = "maximum_bipartite_matching";
3608 : static const char __pyx_k_No_matching_signature_found[] = "No matching signature found";
3609 : static const char __pyx_k_Step_may_not_be_zero_axis_d[] = "Step may not be zero (axis %d)";
3610 : static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
3611 : static const char __pyx_k_reverse_cuthill_mckee_line_16[] = "reverse_cuthill_mckee (line 16)";
3612 : static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
3613 : static const char __pyx_k_convert_pydata_sparse_to_scipy[] = "convert_pydata_sparse_to_scipy";
3614 : static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
3615 : static const char __pyx_k_home_czgdp18079_Quansight_scipy[] = "/home/czgdp18079/Quansight/scipy/scipy/sparse/csgraph/_reordering.pyx";
3616 : static const char __pyx_k_reverse_cuthill_mckee_graph_sym[] = "\n reverse_cuthill_mckee(graph, symmetric_mode=False)\n \n Returns the permutation array that orders a sparse CSR or CSC matrix\n in Reverse-Cuthill McKee ordering. \n \n It is assumed by default, ``symmetric_mode=False``, that the input matrix \n is not symmetric and works on the matrix ``A+A.T``. If you are \n guaranteed that the matrix is symmetric in structure (values of matrix \n elements do not matter) then set ``symmetric_mode=True``.\n \n Parameters\n ----------\n graph : sparse array or matrix\n Input sparse in CSC or CSR sparse array or matrix format.\n symmetric_mode : bool, optional\n Is input matrix guaranteed to be symmetric.\n\n Returns\n -------\n perm : ndarray\n Array of permuted row and column indices.\n \n Notes\n -----\n .. versionadded:: 0.15.0\n\n References\n ----------\n E. Cuthill and J. McKee, \"Reducing the Bandwidth of Sparse Symmetric Matrices\",\n ACM '69 Proceedings of the 1969 24th national conference, (1969).\n\n Examples\n --------\n >>> from scipy.sparse import csr_array\n >>> from scipy.sparse.csgraph import reverse_cuthill_mckee\n\n >>> graph = [\n ... [0, 1, 2, 0],\n ... [0, 0, 0, 1],\n ... [2, 0, 0, 3],\n ... [0, 0, 0, 0]\n ... ]\n >>> graph = csr_array(graph)\n >>> print(graph)\n <Compressed Sparse Row sparse array of dtype 'int64'\n with 5 stored elements and shape (4, 4)>\n Coords\tValues\n (0, 1)\t1\n (0, 2)\t2\n (1, 3)\t1\n (2, 0)\t2\n (2, 3)\t3\n\n >>> reverse_cuthill_mckee(graph)\n array([3, 2, 1, 0], dtype=int32)\n \n ";
3617 : static const char __pyx_k_structural_rank_graph_Compute_t[] = "\n structural_rank(graph)\n \n Compute the structural rank of a graph (matrix) with a given \n sparsity pattern.\n\n The structural rank of a matrix is the number of entries in the maximum \n transversal of the corresponding bipartite graph, and is an upper bound \n on the numerical rank of the matrix. A graph has full structural rank \n if it is possible to permute the elements to make the diagonal zero-free.\n\n .. versionadded:: 0.19.0\n\n Parameters\n ----------\n graph : sparse array or matrix\n Input sparse array.\n\n Returns\n -------\n rank : int\n The structural rank of the sparse graph.\n \n References\n ----------\n .. [1] I. S. Duff, \"Computing the Structural Index\", SIAM J. Alg. Disc. \n Meth., Vol. 7, 594 (1986).\n \n .. [2] http://www.cise.ufl.edu/research/sparse/matrices/legend.html\n\n Examples\n --------\n >>> from scipy.sparse import csr_array\n >>> from scipy.sparse.csgraph import structural_rank\n\n >>> graph = [\n ... [0, 1, 2, 0],\n ... [1, 0, 0, 1],\n ... [2, 0, 0, 3],\n ... [0, 1, 3, 0]\n ... ]\n >>> graph = csr_array(graph)\n >>> print(graph)\n <Compressed Sparse Row sparse array of dtype 'int64'\n with 8 stored elements and shape (4, 4)>\n Coords\tValues\n (0, 1)\t1\n (0, 2)\t2\n (1, 0)\t1\n (1, 3)\t1\n (2, 0)\t2\n (2, 3)\t3\n (3, 1)\t1\n (3, 2)\t3\n\n >>> structural_rank(graph)\n 4\n\n ";
3618 : static const char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced";
3619 : static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
3620 : static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
3621 : static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
3622 : static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
3623 : static const char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions";
3624 : static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
3625 : static const char __pyx_k_Expected_at_least_d_argument_s_g[] = "Expected at least %d argument%s, got %d";
3626 : static const char __pyx_k_Function_call_with_ambiguous_arg[] = "Function call with ambiguous argument types";
3627 : static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))";
3628 : static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
3629 : static const char __pyx_k_Input_matrix_should_be_in_CSC_CS[] = "Input matrix should be in CSC, CSR, or COO matrix format";
3630 : static const char __pyx_k_Input_must_be_in_CSC_or_CSR_spar[] = "Input must be in CSC or CSR sparse format.";
3631 : static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got ";
3632 : static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis ";
3633 : static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
3634 : static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension ";
3635 : static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
3636 : static const char __pyx_k_numpy__core_multiarray_failed_to[] = "numpy._core.multiarray failed to import";
3637 : static const char __pyx_k_numpy__core_umath_failed_to_impo[] = "numpy._core.umath failed to import";
3638 : static const char __pyx_k_scipy_sparse_csgraph__reordering[] = "scipy.sparse.csgraph._reordering";
3639 : static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
3640 : /* #### Code section: decls ### */
3641 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
3642 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3643 : static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3644 : static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3645 : static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3646 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
3647 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
3648 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
3649 : static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
3650 : static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3651 : static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
3652 : static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3653 : static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3654 : static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3655 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
3656 : static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3657 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
3658 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
3659 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3660 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3661 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3662 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3663 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3664 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3665 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3666 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3667 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3668 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3669 : static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3670 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3671 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3672 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3673 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3674 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3675 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3676 : static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3677 : static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3678 : static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3679 : static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3680 : static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3681 : static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3682 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_11_reordering_reverse_cuthill_mckee(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_graph, PyObject *__pyx_v_symmetric_mode); /* proto */
3683 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_11_reordering_2_reverse_cuthill_mckee(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults, PyObject *__pyx_v__fused_sigindex); /* proto */
3684 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_11_reordering_6_reverse_cuthill_mckee(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_ind, PyArrayObject *__pyx_v_ptr, npy_intp __pyx_v_num_rows); /* proto */
3685 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_11_reordering_8_reverse_cuthill_mckee(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_ind, PyArrayObject *__pyx_v_ptr, npy_intp __pyx_v_num_rows); /* proto */
3686 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_11_reordering_4structural_rank(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_graph); /* proto */
3687 : static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3688 : static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3689 : static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3690 : static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3691 : static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, 0, 0, 0, 0};
3692 : static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values = {0, 0, 0, 0, 0};
3693 : /* #### Code section: late_includes ### */
3694 : /* #### Code section: module_state ### */
3695 : typedef struct {
3696 : PyObject *__pyx_d;
3697 : PyObject *__pyx_b;
3698 : PyObject *__pyx_cython_runtime;
3699 : PyObject *__pyx_empty_tuple;
3700 : PyObject *__pyx_empty_bytes;
3701 : PyObject *__pyx_empty_unicode;
3702 : #ifdef __Pyx_CyFunction_USED
3703 : PyTypeObject *__pyx_CyFunctionType;
3704 : #endif
3705 : #ifdef __Pyx_FusedFunction_USED
3706 : PyTypeObject *__pyx_FusedFunctionType;
3707 : #endif
3708 : #ifdef __Pyx_Generator_USED
3709 : PyTypeObject *__pyx_GeneratorType;
3710 : #endif
3711 : #ifdef __Pyx_IterableCoroutine_USED
3712 : PyTypeObject *__pyx_IterableCoroutineType;
3713 : #endif
3714 : #ifdef __Pyx_Coroutine_USED
3715 : PyTypeObject *__pyx_CoroutineAwaitType;
3716 : #endif
3717 : #ifdef __Pyx_Coroutine_USED
3718 : PyTypeObject *__pyx_CoroutineType;
3719 : #endif
3720 : #if CYTHON_USE_MODULE_STATE
3721 : #endif
3722 : #if CYTHON_USE_MODULE_STATE
3723 : #endif
3724 : #if CYTHON_USE_MODULE_STATE
3725 : #endif
3726 : #if CYTHON_USE_MODULE_STATE
3727 : #endif
3728 : PyTypeObject *__pyx_ptype_7cpython_4type_type;
3729 : #if CYTHON_USE_MODULE_STATE
3730 : #endif
3731 : #if CYTHON_USE_MODULE_STATE
3732 : #endif
3733 : #if CYTHON_USE_MODULE_STATE
3734 : #endif
3735 : #if CYTHON_USE_MODULE_STATE
3736 : #endif
3737 : #if CYTHON_USE_MODULE_STATE
3738 : #endif
3739 : PyTypeObject *__pyx_ptype_5numpy_dtype;
3740 : PyTypeObject *__pyx_ptype_5numpy_flatiter;
3741 : PyTypeObject *__pyx_ptype_5numpy_broadcast;
3742 : PyTypeObject *__pyx_ptype_5numpy_ndarray;
3743 : PyTypeObject *__pyx_ptype_5numpy_generic;
3744 : PyTypeObject *__pyx_ptype_5numpy_number;
3745 : PyTypeObject *__pyx_ptype_5numpy_integer;
3746 : PyTypeObject *__pyx_ptype_5numpy_signedinteger;
3747 : PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
3748 : PyTypeObject *__pyx_ptype_5numpy_inexact;
3749 : PyTypeObject *__pyx_ptype_5numpy_floating;
3750 : PyTypeObject *__pyx_ptype_5numpy_complexfloating;
3751 : PyTypeObject *__pyx_ptype_5numpy_flexible;
3752 : PyTypeObject *__pyx_ptype_5numpy_character;
3753 : PyTypeObject *__pyx_ptype_5numpy_ufunc;
3754 : #if CYTHON_USE_MODULE_STATE
3755 : PyObject *__pyx_type___pyx_array;
3756 : PyObject *__pyx_type___pyx_MemviewEnum;
3757 : PyObject *__pyx_type___pyx_memoryview;
3758 : PyObject *__pyx_type___pyx_memoryviewslice;
3759 : #endif
3760 : PyTypeObject *__pyx_array_type;
3761 : PyTypeObject *__pyx_MemviewEnum_type;
3762 : PyTypeObject *__pyx_memoryview_type;
3763 : PyTypeObject *__pyx_memoryviewslice_type;
3764 : PyObject *__pyx_kp_u_;
3765 : PyObject *__pyx_n_s_ASCII;
3766 : PyObject *__pyx_kp_s_All_dimensions_preceding_dimensi;
3767 : PyObject *__pyx_n_s_AssertionError;
3768 : PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
3769 : PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
3770 : PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
3771 : PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
3772 : PyObject *__pyx_kp_u_Cannot_index_with_type;
3773 : PyObject *__pyx_kp_s_Cannot_transpose_memoryview_with;
3774 : PyObject *__pyx_n_s_DTYPE;
3775 : PyObject *__pyx_kp_s_Dimension_d_is_not_direct;
3776 : PyObject *__pyx_n_s_Ellipsis;
3777 : PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
3778 : PyObject *__pyx_kp_s_Expected_at_least_d_argument_s_g;
3779 : PyObject *__pyx_kp_s_Function_call_with_ambiguous_arg;
3780 : PyObject *__pyx_n_s_ITYPE;
3781 : PyObject *__pyx_n_s_ImportError;
3782 : PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
3783 : PyObject *__pyx_n_s_IndexError;
3784 : PyObject *__pyx_kp_s_Index_out_of_bounds_axis_d;
3785 : PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
3786 : PyObject *__pyx_kp_u_Input_graph_must_be_sparse;
3787 : PyObject *__pyx_kp_u_Input_matrix_should_be_in_CSC_CS;
3788 : PyObject *__pyx_kp_u_Input_must_be_in_CSC_or_CSR_spar;
3789 : PyObject *__pyx_kp_u_Input_must_be_sparse;
3790 : PyObject *__pyx_kp_u_Invalid_mode_expected_c_or_fortr;
3791 : PyObject *__pyx_kp_u_Invalid_shape_in_axis;
3792 : PyObject *__pyx_n_s_MemoryError;
3793 : PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
3794 : PyObject *__pyx_kp_s_MemoryView_of_r_object;
3795 : PyObject *__pyx_n_s_N;
3796 : PyObject *__pyx_n_s_N_old;
3797 : PyObject *__pyx_kp_s_No_matching_signature_found;
3798 : PyObject *__pyx_n_b_O;
3799 : PyObject *__pyx_kp_u_Out_of_bounds_on_buffer_access_a;
3800 : PyObject *__pyx_n_s_PickleError;
3801 : PyObject *__pyx_n_s_Sequence;
3802 : PyObject *__pyx_n_s_SparseEfficiencyWarning;
3803 : PyObject *__pyx_kp_s_Step_may_not_be_zero_axis_d;
3804 : PyObject *__pyx_n_s_T;
3805 : PyObject *__pyx_n_s_TypeError;
3806 : PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
3807 : PyObject *__pyx_n_s_ValueError;
3808 : PyObject *__pyx_n_s_View_MemoryView;
3809 : PyObject *__pyx_kp_s__13;
3810 : PyObject *__pyx_kp_s__14;
3811 : PyObject *__pyx_kp_u__14;
3812 : PyObject *__pyx_kp_u__2;
3813 : PyObject *__pyx_n_s__3;
3814 : PyObject *__pyx_n_s__30;
3815 : PyObject *__pyx_n_s__38;
3816 : PyObject *__pyx_kp_u__6;
3817 : PyObject *__pyx_kp_u__7;
3818 : PyObject *__pyx_n_s_abc;
3819 : PyObject *__pyx_n_s_allocate_buffer;
3820 : PyObject *__pyx_kp_u_and;
3821 : PyObject *__pyx_n_s_args;
3822 : PyObject *__pyx_n_s_argsort;
3823 : PyObject *__pyx_n_s_asyncio_coroutines;
3824 : PyObject *__pyx_n_s_base;
3825 : PyObject *__pyx_n_s_c;
3826 : PyObject *__pyx_n_u_c;
3827 : PyObject *__pyx_n_s_class;
3828 : PyObject *__pyx_n_s_class_getitem;
3829 : PyObject *__pyx_n_s_cline_in_traceback;
3830 : PyObject *__pyx_n_s_collections;
3831 : PyObject *__pyx_kp_s_collections_abc;
3832 : PyObject *__pyx_kp_s_contiguous_and_direct;
3833 : PyObject *__pyx_kp_s_contiguous_and_indirect;
3834 : PyObject *__pyx_n_s_convert_pydata_sparse_to_scipy;
3835 : PyObject *__pyx_n_u_coo;
3836 : PyObject *__pyx_n_s_count;
3837 : PyObject *__pyx_n_u_csc;
3838 : PyObject *__pyx_n_u_csr;
3839 : PyObject *__pyx_n_s_csr_array;
3840 : PyObject *__pyx_n_s_defaults;
3841 : PyObject *__pyx_n_s_degree;
3842 : PyObject *__pyx_n_s_dict;
3843 : PyObject *__pyx_kp_u_disable;
3844 : PyObject *__pyx_n_s_dtype;
3845 : PyObject *__pyx_n_s_dtype_is_object;
3846 : PyObject *__pyx_kp_u_enable;
3847 : PyObject *__pyx_n_s_encode;
3848 : PyObject *__pyx_n_s_enumerate;
3849 : PyObject *__pyx_n_s_error;
3850 : PyObject *__pyx_n_s_flags;
3851 : PyObject *__pyx_n_s_float64;
3852 : PyObject *__pyx_n_s_format;
3853 : PyObject *__pyx_n_s_fortran;
3854 : PyObject *__pyx_n_u_fortran;
3855 : PyObject *__pyx_n_s_fused_sigindex;
3856 : PyObject *__pyx_kp_u_gc;
3857 : PyObject *__pyx_n_s_get;
3858 : PyObject *__pyx_n_s_getstate;
3859 : PyObject *__pyx_kp_u_got;
3860 : PyObject *__pyx_kp_u_got_differing_extents_in_dimensi;
3861 : PyObject *__pyx_n_s_graph;
3862 : PyObject *__pyx_kp_s_home_czgdp18079_Quansight_scipy;
3863 : PyObject *__pyx_n_s_i;
3864 : PyObject *__pyx_n_s_id;
3865 : PyObject *__pyx_n_s_ii;
3866 : PyObject *__pyx_n_s_import;
3867 : PyObject *__pyx_n_s_ind;
3868 : PyObject *__pyx_n_s_index;
3869 : PyObject *__pyx_n_s_indices;
3870 : PyObject *__pyx_n_s_indptr;
3871 : PyObject *__pyx_n_s_inds;
3872 : PyObject *__pyx_n_s_initializing;
3873 : PyObject *__pyx_n_s_int32;
3874 : PyObject *__pyx_n_s_int32_t;
3875 : PyObject *__pyx_n_s_int64_t;
3876 : PyObject *__pyx_n_s_is_coroutine;
3877 : PyObject *__pyx_kp_u_isenabled;
3878 : PyObject *__pyx_n_s_issparse;
3879 : PyObject *__pyx_n_s_itemsize;
3880 : PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
3881 : PyObject *__pyx_n_s_j;
3882 : PyObject *__pyx_n_s_jj;
3883 : PyObject *__pyx_n_s_kind;
3884 : PyObject *__pyx_n_s_kk;
3885 : PyObject *__pyx_n_s_kwargs;
3886 : PyObject *__pyx_n_s_level_end;
3887 : PyObject *__pyx_n_s_level_len;
3888 : PyObject *__pyx_n_s_level_start;
3889 : PyObject *__pyx_n_s_ll;
3890 : PyObject *__pyx_n_s_main;
3891 : PyObject *__pyx_n_s_max;
3892 : PyObject *__pyx_n_s_maximum_bipartite_matching;
3893 : PyObject *__pyx_n_s_memview;
3894 : PyObject *__pyx_n_s_mode;
3895 : PyObject *__pyx_n_s_name;
3896 : PyObject *__pyx_n_s_name_2;
3897 : PyObject *__pyx_n_s_ndim;
3898 : PyObject *__pyx_n_s_new;
3899 : PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
3900 : PyObject *__pyx_n_s_np;
3901 : PyObject *__pyx_n_s_nrows;
3902 : PyObject *__pyx_n_s_num_rows;
3903 : PyObject *__pyx_n_s_numpy;
3904 : PyObject *__pyx_kp_u_numpy__core_multiarray_failed_to;
3905 : PyObject *__pyx_kp_u_numpy__core_umath_failed_to_impo;
3906 : PyObject *__pyx_n_s_obj;
3907 : PyObject *__pyx_n_s_order;
3908 : PyObject *__pyx_n_s_pack;
3909 : PyObject *__pyx_n_s_pickle;
3910 : PyObject *__pyx_n_s_ptr;
3911 : PyObject *__pyx_n_s_pyx_PickleError;
3912 : PyObject *__pyx_n_s_pyx_checksum;
3913 : PyObject *__pyx_n_s_pyx_result;
3914 : PyObject *__pyx_n_s_pyx_state;
3915 : PyObject *__pyx_n_s_pyx_type;
3916 : PyObject *__pyx_n_s_pyx_unpickle_Enum;
3917 : PyObject *__pyx_n_s_pyx_vtable;
3918 : PyObject *__pyx_n_s_range;
3919 : PyObject *__pyx_n_s_rank;
3920 : PyObject *__pyx_n_s_reduce;
3921 : PyObject *__pyx_n_s_reduce_cython;
3922 : PyObject *__pyx_n_s_reduce_ex;
3923 : PyObject *__pyx_n_s_register;
3924 : PyObject *__pyx_n_s_rev_inds;
3925 : PyObject *__pyx_n_s_reverse_cuthill_mckee;
3926 : PyObject *__pyx_n_s_reverse_cuthill_mckee_2;
3927 : PyObject *__pyx_kp_u_reverse_cuthill_mckee_graph_sym;
3928 : PyObject *__pyx_kp_u_reverse_cuthill_mckee_line_16;
3929 : PyObject *__pyx_n_s_s;
3930 : PyObject *__pyx_n_s_scipy_sparse;
3931 : PyObject *__pyx_n_s_scipy_sparse__sputils;
3932 : PyObject *__pyx_n_s_scipy_sparse_csgraph__reordering;
3933 : PyObject *__pyx_n_s_seed;
3934 : PyObject *__pyx_n_s_setstate;
3935 : PyObject *__pyx_n_s_setstate_cython;
3936 : PyObject *__pyx_n_s_shape;
3937 : PyObject *__pyx_n_s_signatures;
3938 : PyObject *__pyx_n_s_size;
3939 : PyObject *__pyx_n_s_spec;
3940 : PyObject *__pyx_n_s_split;
3941 : PyObject *__pyx_n_s_start;
3942 : PyObject *__pyx_n_s_step;
3943 : PyObject *__pyx_n_s_stop;
3944 : PyObject *__pyx_kp_s_strided_and_direct;
3945 : PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
3946 : PyObject *__pyx_kp_s_strided_and_indirect;
3947 : PyObject *__pyx_kp_s_stringsource;
3948 : PyObject *__pyx_n_s_strip;
3949 : PyObject *__pyx_n_s_struct;
3950 : PyObject *__pyx_n_s_structural_rank;
3951 : PyObject *__pyx_kp_u_structural_rank_graph_Compute_t;
3952 : PyObject *__pyx_kp_u_structural_rank_line_177;
3953 : PyObject *__pyx_n_s_sum;
3954 : PyObject *__pyx_n_s_symmetric_mode;
3955 : PyObject *__pyx_n_s_sys;
3956 : PyObject *__pyx_n_s_temp;
3957 : PyObject *__pyx_n_s_temp2;
3958 : PyObject *__pyx_n_s_temp_degrees;
3959 : PyObject *__pyx_n_s_test;
3960 : PyObject *__pyx_n_s_tocsr;
3961 : PyObject *__pyx_n_s_transpose;
3962 : PyObject *__pyx_kp_s_unable_to_allocate_array_data;
3963 : PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
3964 : PyObject *__pyx_n_s_unpack;
3965 : PyObject *__pyx_n_s_update;
3966 : PyObject *__pyx_n_s_values;
3967 : PyObject *__pyx_n_s_version_info;
3968 : PyObject *__pyx_n_s_warn;
3969 : PyObject *__pyx_n_s_warnings;
3970 : PyObject *__pyx_n_s_zeros;
3971 : PyObject *__pyx_n_s_zz;
3972 : PyObject *__pyx_int_0;
3973 : PyObject *__pyx_int_1;
3974 : PyObject *__pyx_int_3;
3975 : PyObject *__pyx_int_112105877;
3976 : PyObject *__pyx_int_136983863;
3977 : PyObject *__pyx_int_184977713;
3978 : PyObject *__pyx_int_neg_1;
3979 : PyObject *__pyx_slice__5;
3980 : PyObject *__pyx_tuple__4;
3981 : PyObject *__pyx_tuple__8;
3982 : PyObject *__pyx_tuple__9;
3983 : PyObject *__pyx_slice__17;
3984 : PyObject *__pyx_tuple__10;
3985 : PyObject *__pyx_tuple__11;
3986 : PyObject *__pyx_tuple__12;
3987 : PyObject *__pyx_tuple__15;
3988 : PyObject *__pyx_tuple__16;
3989 : PyObject *__pyx_tuple__18;
3990 : PyObject *__pyx_tuple__19;
3991 : PyObject *__pyx_tuple__20;
3992 : PyObject *__pyx_tuple__21;
3993 : PyObject *__pyx_tuple__22;
3994 : PyObject *__pyx_tuple__23;
3995 : PyObject *__pyx_tuple__24;
3996 : PyObject *__pyx_tuple__25;
3997 : PyObject *__pyx_tuple__26;
3998 : PyObject *__pyx_tuple__27;
3999 : PyObject *__pyx_tuple__28;
4000 : PyObject *__pyx_tuple__31;
4001 : PyObject *__pyx_tuple__33;
4002 : PyObject *__pyx_tuple__34;
4003 : PyObject *__pyx_tuple__36;
4004 : PyObject *__pyx_codeobj__29;
4005 : PyObject *__pyx_codeobj__32;
4006 : PyObject *__pyx_codeobj__35;
4007 : PyObject *__pyx_codeobj__37;
4008 : } __pyx_mstate;
4009 :
4010 : #if CYTHON_USE_MODULE_STATE
4011 : #ifdef __cplusplus
4012 : namespace {
4013 : extern struct PyModuleDef __pyx_moduledef;
4014 : } /* anonymous namespace */
4015 : #else
4016 : static struct PyModuleDef __pyx_moduledef;
4017 : #endif
4018 :
4019 : #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))
4020 :
4021 : #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))
4022 :
4023 : #define __pyx_m (PyState_FindModule(&__pyx_moduledef))
4024 : #else
4025 : static __pyx_mstate __pyx_mstate_global_static =
4026 : #ifdef __cplusplus
4027 : {};
4028 : #else
4029 : {0};
4030 : #endif
4031 : static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static;
4032 : #endif
4033 : /* #### Code section: module_state_clear ### */
4034 : #if CYTHON_USE_MODULE_STATE
4035 : static int __pyx_m_clear(PyObject *m) {
4036 : __pyx_mstate *clear_module_state = __pyx_mstate(m);
4037 : if (!clear_module_state) return 0;
4038 : Py_CLEAR(clear_module_state->__pyx_d);
4039 : Py_CLEAR(clear_module_state->__pyx_b);
4040 : Py_CLEAR(clear_module_state->__pyx_cython_runtime);
4041 : Py_CLEAR(clear_module_state->__pyx_empty_tuple);
4042 : Py_CLEAR(clear_module_state->__pyx_empty_bytes);
4043 : Py_CLEAR(clear_module_state->__pyx_empty_unicode);
4044 : #ifdef __Pyx_CyFunction_USED
4045 : Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
4046 : #endif
4047 : #ifdef __Pyx_FusedFunction_USED
4048 : Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
4049 : #endif
4050 : Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
4051 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
4052 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
4053 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
4054 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
4055 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
4056 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
4057 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
4058 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
4059 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
4060 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
4061 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
4062 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
4063 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
4064 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
4065 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
4066 : Py_CLEAR(clear_module_state->__pyx_array_type);
4067 : Py_CLEAR(clear_module_state->__pyx_type___pyx_array);
4068 : Py_CLEAR(clear_module_state->__pyx_MemviewEnum_type);
4069 : Py_CLEAR(clear_module_state->__pyx_type___pyx_MemviewEnum);
4070 : Py_CLEAR(clear_module_state->__pyx_memoryview_type);
4071 : Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryview);
4072 : Py_CLEAR(clear_module_state->__pyx_memoryviewslice_type);
4073 : Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryviewslice);
4074 : Py_CLEAR(clear_module_state->__pyx_kp_u_);
4075 : Py_CLEAR(clear_module_state->__pyx_n_s_ASCII);
4076 : Py_CLEAR(clear_module_state->__pyx_kp_s_All_dimensions_preceding_dimensi);
4077 : Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError);
4078 : Py_CLEAR(clear_module_state->__pyx_kp_s_Buffer_view_does_not_expose_stri);
4079 : Py_CLEAR(clear_module_state->__pyx_kp_s_Can_only_create_a_buffer_that_is);
4080 : Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_assign_to_read_only_memor);
4081 : Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_create_writable_memory_vi);
4082 : Py_CLEAR(clear_module_state->__pyx_kp_u_Cannot_index_with_type);
4083 : Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_transpose_memoryview_with);
4084 : Py_CLEAR(clear_module_state->__pyx_n_s_DTYPE);
4085 : Py_CLEAR(clear_module_state->__pyx_kp_s_Dimension_d_is_not_direct);
4086 : Py_CLEAR(clear_module_state->__pyx_n_s_Ellipsis);
4087 : Py_CLEAR(clear_module_state->__pyx_kp_s_Empty_shape_tuple_for_cython_arr);
4088 : Py_CLEAR(clear_module_state->__pyx_kp_s_Expected_at_least_d_argument_s_g);
4089 : Py_CLEAR(clear_module_state->__pyx_kp_s_Function_call_with_ambiguous_arg);
4090 : Py_CLEAR(clear_module_state->__pyx_n_s_ITYPE);
4091 : Py_CLEAR(clear_module_state->__pyx_n_s_ImportError);
4092 : Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
4093 : Py_CLEAR(clear_module_state->__pyx_n_s_IndexError);
4094 : Py_CLEAR(clear_module_state->__pyx_kp_s_Index_out_of_bounds_axis_d);
4095 : Py_CLEAR(clear_module_state->__pyx_kp_s_Indirect_dimensions_not_supporte);
4096 : Py_CLEAR(clear_module_state->__pyx_kp_u_Input_graph_must_be_sparse);
4097 : Py_CLEAR(clear_module_state->__pyx_kp_u_Input_matrix_should_be_in_CSC_CS);
4098 : Py_CLEAR(clear_module_state->__pyx_kp_u_Input_must_be_in_CSC_or_CSR_spar);
4099 : Py_CLEAR(clear_module_state->__pyx_kp_u_Input_must_be_sparse);
4100 : Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_mode_expected_c_or_fortr);
4101 : Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_shape_in_axis);
4102 : Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError);
4103 : Py_CLEAR(clear_module_state->__pyx_kp_s_MemoryView_of_r_at_0x_x);
4104 : Py_CLEAR(clear_module_state->__pyx_kp_s_MemoryView_of_r_object);
4105 : Py_CLEAR(clear_module_state->__pyx_n_s_N);
4106 : Py_CLEAR(clear_module_state->__pyx_n_s_N_old);
4107 : Py_CLEAR(clear_module_state->__pyx_kp_s_No_matching_signature_found);
4108 : Py_CLEAR(clear_module_state->__pyx_n_b_O);
4109 : Py_CLEAR(clear_module_state->__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
4110 : Py_CLEAR(clear_module_state->__pyx_n_s_PickleError);
4111 : Py_CLEAR(clear_module_state->__pyx_n_s_Sequence);
4112 : Py_CLEAR(clear_module_state->__pyx_n_s_SparseEfficiencyWarning);
4113 : Py_CLEAR(clear_module_state->__pyx_kp_s_Step_may_not_be_zero_axis_d);
4114 : Py_CLEAR(clear_module_state->__pyx_n_s_T);
4115 : Py_CLEAR(clear_module_state->__pyx_n_s_TypeError);
4116 : Py_CLEAR(clear_module_state->__pyx_kp_s_Unable_to_convert_item_to_object);
4117 : Py_CLEAR(clear_module_state->__pyx_n_s_ValueError);
4118 : Py_CLEAR(clear_module_state->__pyx_n_s_View_MemoryView);
4119 : Py_CLEAR(clear_module_state->__pyx_kp_s__13);
4120 : Py_CLEAR(clear_module_state->__pyx_kp_s__14);
4121 : Py_CLEAR(clear_module_state->__pyx_kp_u__14);
4122 : Py_CLEAR(clear_module_state->__pyx_kp_u__2);
4123 : Py_CLEAR(clear_module_state->__pyx_n_s__3);
4124 : Py_CLEAR(clear_module_state->__pyx_n_s__30);
4125 : Py_CLEAR(clear_module_state->__pyx_n_s__38);
4126 : Py_CLEAR(clear_module_state->__pyx_kp_u__6);
4127 : Py_CLEAR(clear_module_state->__pyx_kp_u__7);
4128 : Py_CLEAR(clear_module_state->__pyx_n_s_abc);
4129 : Py_CLEAR(clear_module_state->__pyx_n_s_allocate_buffer);
4130 : Py_CLEAR(clear_module_state->__pyx_kp_u_and);
4131 : Py_CLEAR(clear_module_state->__pyx_n_s_args);
4132 : Py_CLEAR(clear_module_state->__pyx_n_s_argsort);
4133 : Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
4134 : Py_CLEAR(clear_module_state->__pyx_n_s_base);
4135 : Py_CLEAR(clear_module_state->__pyx_n_s_c);
4136 : Py_CLEAR(clear_module_state->__pyx_n_u_c);
4137 : Py_CLEAR(clear_module_state->__pyx_n_s_class);
4138 : Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem);
4139 : Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
4140 : Py_CLEAR(clear_module_state->__pyx_n_s_collections);
4141 : Py_CLEAR(clear_module_state->__pyx_kp_s_collections_abc);
4142 : Py_CLEAR(clear_module_state->__pyx_kp_s_contiguous_and_direct);
4143 : Py_CLEAR(clear_module_state->__pyx_kp_s_contiguous_and_indirect);
4144 : Py_CLEAR(clear_module_state->__pyx_n_s_convert_pydata_sparse_to_scipy);
4145 : Py_CLEAR(clear_module_state->__pyx_n_u_coo);
4146 : Py_CLEAR(clear_module_state->__pyx_n_s_count);
4147 : Py_CLEAR(clear_module_state->__pyx_n_u_csc);
4148 : Py_CLEAR(clear_module_state->__pyx_n_u_csr);
4149 : Py_CLEAR(clear_module_state->__pyx_n_s_csr_array);
4150 : Py_CLEAR(clear_module_state->__pyx_n_s_defaults);
4151 : Py_CLEAR(clear_module_state->__pyx_n_s_degree);
4152 : Py_CLEAR(clear_module_state->__pyx_n_s_dict);
4153 : Py_CLEAR(clear_module_state->__pyx_kp_u_disable);
4154 : Py_CLEAR(clear_module_state->__pyx_n_s_dtype);
4155 : Py_CLEAR(clear_module_state->__pyx_n_s_dtype_is_object);
4156 : Py_CLEAR(clear_module_state->__pyx_kp_u_enable);
4157 : Py_CLEAR(clear_module_state->__pyx_n_s_encode);
4158 : Py_CLEAR(clear_module_state->__pyx_n_s_enumerate);
4159 : Py_CLEAR(clear_module_state->__pyx_n_s_error);
4160 : Py_CLEAR(clear_module_state->__pyx_n_s_flags);
4161 : Py_CLEAR(clear_module_state->__pyx_n_s_float64);
4162 : Py_CLEAR(clear_module_state->__pyx_n_s_format);
4163 : Py_CLEAR(clear_module_state->__pyx_n_s_fortran);
4164 : Py_CLEAR(clear_module_state->__pyx_n_u_fortran);
4165 : Py_CLEAR(clear_module_state->__pyx_n_s_fused_sigindex);
4166 : Py_CLEAR(clear_module_state->__pyx_kp_u_gc);
4167 : Py_CLEAR(clear_module_state->__pyx_n_s_get);
4168 : Py_CLEAR(clear_module_state->__pyx_n_s_getstate);
4169 : Py_CLEAR(clear_module_state->__pyx_kp_u_got);
4170 : Py_CLEAR(clear_module_state->__pyx_kp_u_got_differing_extents_in_dimensi);
4171 : Py_CLEAR(clear_module_state->__pyx_n_s_graph);
4172 : Py_CLEAR(clear_module_state->__pyx_kp_s_home_czgdp18079_Quansight_scipy);
4173 : Py_CLEAR(clear_module_state->__pyx_n_s_i);
4174 : Py_CLEAR(clear_module_state->__pyx_n_s_id);
4175 : Py_CLEAR(clear_module_state->__pyx_n_s_ii);
4176 : Py_CLEAR(clear_module_state->__pyx_n_s_import);
4177 : Py_CLEAR(clear_module_state->__pyx_n_s_ind);
4178 : Py_CLEAR(clear_module_state->__pyx_n_s_index);
4179 : Py_CLEAR(clear_module_state->__pyx_n_s_indices);
4180 : Py_CLEAR(clear_module_state->__pyx_n_s_indptr);
4181 : Py_CLEAR(clear_module_state->__pyx_n_s_inds);
4182 : Py_CLEAR(clear_module_state->__pyx_n_s_initializing);
4183 : Py_CLEAR(clear_module_state->__pyx_n_s_int32);
4184 : Py_CLEAR(clear_module_state->__pyx_n_s_int32_t);
4185 : Py_CLEAR(clear_module_state->__pyx_n_s_int64_t);
4186 : Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
4187 : Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled);
4188 : Py_CLEAR(clear_module_state->__pyx_n_s_issparse);
4189 : Py_CLEAR(clear_module_state->__pyx_n_s_itemsize);
4190 : Py_CLEAR(clear_module_state->__pyx_kp_s_itemsize_0_for_cython_array);
4191 : Py_CLEAR(clear_module_state->__pyx_n_s_j);
4192 : Py_CLEAR(clear_module_state->__pyx_n_s_jj);
4193 : Py_CLEAR(clear_module_state->__pyx_n_s_kind);
4194 : Py_CLEAR(clear_module_state->__pyx_n_s_kk);
4195 : Py_CLEAR(clear_module_state->__pyx_n_s_kwargs);
4196 : Py_CLEAR(clear_module_state->__pyx_n_s_level_end);
4197 : Py_CLEAR(clear_module_state->__pyx_n_s_level_len);
4198 : Py_CLEAR(clear_module_state->__pyx_n_s_level_start);
4199 : Py_CLEAR(clear_module_state->__pyx_n_s_ll);
4200 : Py_CLEAR(clear_module_state->__pyx_n_s_main);
4201 : Py_CLEAR(clear_module_state->__pyx_n_s_max);
4202 : Py_CLEAR(clear_module_state->__pyx_n_s_maximum_bipartite_matching);
4203 : Py_CLEAR(clear_module_state->__pyx_n_s_memview);
4204 : Py_CLEAR(clear_module_state->__pyx_n_s_mode);
4205 : Py_CLEAR(clear_module_state->__pyx_n_s_name);
4206 : Py_CLEAR(clear_module_state->__pyx_n_s_name_2);
4207 : Py_CLEAR(clear_module_state->__pyx_n_s_ndim);
4208 : Py_CLEAR(clear_module_state->__pyx_n_s_new);
4209 : Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
4210 : Py_CLEAR(clear_module_state->__pyx_n_s_np);
4211 : Py_CLEAR(clear_module_state->__pyx_n_s_nrows);
4212 : Py_CLEAR(clear_module_state->__pyx_n_s_num_rows);
4213 : Py_CLEAR(clear_module_state->__pyx_n_s_numpy);
4214 : Py_CLEAR(clear_module_state->__pyx_kp_u_numpy__core_multiarray_failed_to);
4215 : Py_CLEAR(clear_module_state->__pyx_kp_u_numpy__core_umath_failed_to_impo);
4216 : Py_CLEAR(clear_module_state->__pyx_n_s_obj);
4217 : Py_CLEAR(clear_module_state->__pyx_n_s_order);
4218 : Py_CLEAR(clear_module_state->__pyx_n_s_pack);
4219 : Py_CLEAR(clear_module_state->__pyx_n_s_pickle);
4220 : Py_CLEAR(clear_module_state->__pyx_n_s_ptr);
4221 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError);
4222 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum);
4223 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result);
4224 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state);
4225 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type);
4226 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_Enum);
4227 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable);
4228 : Py_CLEAR(clear_module_state->__pyx_n_s_range);
4229 : Py_CLEAR(clear_module_state->__pyx_n_s_rank);
4230 : Py_CLEAR(clear_module_state->__pyx_n_s_reduce);
4231 : Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython);
4232 : Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex);
4233 : Py_CLEAR(clear_module_state->__pyx_n_s_register);
4234 : Py_CLEAR(clear_module_state->__pyx_n_s_rev_inds);
4235 : Py_CLEAR(clear_module_state->__pyx_n_s_reverse_cuthill_mckee);
4236 : Py_CLEAR(clear_module_state->__pyx_n_s_reverse_cuthill_mckee_2);
4237 : Py_CLEAR(clear_module_state->__pyx_kp_u_reverse_cuthill_mckee_graph_sym);
4238 : Py_CLEAR(clear_module_state->__pyx_kp_u_reverse_cuthill_mckee_line_16);
4239 : Py_CLEAR(clear_module_state->__pyx_n_s_s);
4240 : Py_CLEAR(clear_module_state->__pyx_n_s_scipy_sparse);
4241 : Py_CLEAR(clear_module_state->__pyx_n_s_scipy_sparse__sputils);
4242 : Py_CLEAR(clear_module_state->__pyx_n_s_scipy_sparse_csgraph__reordering);
4243 : Py_CLEAR(clear_module_state->__pyx_n_s_seed);
4244 : Py_CLEAR(clear_module_state->__pyx_n_s_setstate);
4245 : Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython);
4246 : Py_CLEAR(clear_module_state->__pyx_n_s_shape);
4247 : Py_CLEAR(clear_module_state->__pyx_n_s_signatures);
4248 : Py_CLEAR(clear_module_state->__pyx_n_s_size);
4249 : Py_CLEAR(clear_module_state->__pyx_n_s_spec);
4250 : Py_CLEAR(clear_module_state->__pyx_n_s_split);
4251 : Py_CLEAR(clear_module_state->__pyx_n_s_start);
4252 : Py_CLEAR(clear_module_state->__pyx_n_s_step);
4253 : Py_CLEAR(clear_module_state->__pyx_n_s_stop);
4254 : Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_direct);
4255 : Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_direct_or_indirect);
4256 : Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_indirect);
4257 : Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource);
4258 : Py_CLEAR(clear_module_state->__pyx_n_s_strip);
4259 : Py_CLEAR(clear_module_state->__pyx_n_s_struct);
4260 : Py_CLEAR(clear_module_state->__pyx_n_s_structural_rank);
4261 : Py_CLEAR(clear_module_state->__pyx_kp_u_structural_rank_graph_Compute_t);
4262 : Py_CLEAR(clear_module_state->__pyx_kp_u_structural_rank_line_177);
4263 : Py_CLEAR(clear_module_state->__pyx_n_s_sum);
4264 : Py_CLEAR(clear_module_state->__pyx_n_s_symmetric_mode);
4265 : Py_CLEAR(clear_module_state->__pyx_n_s_sys);
4266 : Py_CLEAR(clear_module_state->__pyx_n_s_temp);
4267 : Py_CLEAR(clear_module_state->__pyx_n_s_temp2);
4268 : Py_CLEAR(clear_module_state->__pyx_n_s_temp_degrees);
4269 : Py_CLEAR(clear_module_state->__pyx_n_s_test);
4270 : Py_CLEAR(clear_module_state->__pyx_n_s_tocsr);
4271 : Py_CLEAR(clear_module_state->__pyx_n_s_transpose);
4272 : Py_CLEAR(clear_module_state->__pyx_kp_s_unable_to_allocate_array_data);
4273 : Py_CLEAR(clear_module_state->__pyx_kp_s_unable_to_allocate_shape_and_str);
4274 : Py_CLEAR(clear_module_state->__pyx_n_s_unpack);
4275 : Py_CLEAR(clear_module_state->__pyx_n_s_update);
4276 : Py_CLEAR(clear_module_state->__pyx_n_s_values);
4277 : Py_CLEAR(clear_module_state->__pyx_n_s_version_info);
4278 : Py_CLEAR(clear_module_state->__pyx_n_s_warn);
4279 : Py_CLEAR(clear_module_state->__pyx_n_s_warnings);
4280 : Py_CLEAR(clear_module_state->__pyx_n_s_zeros);
4281 : Py_CLEAR(clear_module_state->__pyx_n_s_zz);
4282 : Py_CLEAR(clear_module_state->__pyx_int_0);
4283 : Py_CLEAR(clear_module_state->__pyx_int_1);
4284 : Py_CLEAR(clear_module_state->__pyx_int_3);
4285 : Py_CLEAR(clear_module_state->__pyx_int_112105877);
4286 : Py_CLEAR(clear_module_state->__pyx_int_136983863);
4287 : Py_CLEAR(clear_module_state->__pyx_int_184977713);
4288 : Py_CLEAR(clear_module_state->__pyx_int_neg_1);
4289 : Py_CLEAR(clear_module_state->__pyx_slice__5);
4290 : Py_CLEAR(clear_module_state->__pyx_tuple__4);
4291 : Py_CLEAR(clear_module_state->__pyx_tuple__8);
4292 : Py_CLEAR(clear_module_state->__pyx_tuple__9);
4293 : Py_CLEAR(clear_module_state->__pyx_slice__17);
4294 : Py_CLEAR(clear_module_state->__pyx_tuple__10);
4295 : Py_CLEAR(clear_module_state->__pyx_tuple__11);
4296 : Py_CLEAR(clear_module_state->__pyx_tuple__12);
4297 : Py_CLEAR(clear_module_state->__pyx_tuple__15);
4298 : Py_CLEAR(clear_module_state->__pyx_tuple__16);
4299 : Py_CLEAR(clear_module_state->__pyx_tuple__18);
4300 : Py_CLEAR(clear_module_state->__pyx_tuple__19);
4301 : Py_CLEAR(clear_module_state->__pyx_tuple__20);
4302 : Py_CLEAR(clear_module_state->__pyx_tuple__21);
4303 : Py_CLEAR(clear_module_state->__pyx_tuple__22);
4304 : Py_CLEAR(clear_module_state->__pyx_tuple__23);
4305 : Py_CLEAR(clear_module_state->__pyx_tuple__24);
4306 : Py_CLEAR(clear_module_state->__pyx_tuple__25);
4307 : Py_CLEAR(clear_module_state->__pyx_tuple__26);
4308 : Py_CLEAR(clear_module_state->__pyx_tuple__27);
4309 : Py_CLEAR(clear_module_state->__pyx_tuple__28);
4310 : Py_CLEAR(clear_module_state->__pyx_tuple__31);
4311 : Py_CLEAR(clear_module_state->__pyx_tuple__33);
4312 : Py_CLEAR(clear_module_state->__pyx_tuple__34);
4313 : Py_CLEAR(clear_module_state->__pyx_tuple__36);
4314 : Py_CLEAR(clear_module_state->__pyx_codeobj__29);
4315 : Py_CLEAR(clear_module_state->__pyx_codeobj__32);
4316 : Py_CLEAR(clear_module_state->__pyx_codeobj__35);
4317 : Py_CLEAR(clear_module_state->__pyx_codeobj__37);
4318 : return 0;
4319 : }
4320 : #endif
4321 : /* #### Code section: module_state_traverse ### */
4322 : #if CYTHON_USE_MODULE_STATE
4323 : static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
4324 : __pyx_mstate *traverse_module_state = __pyx_mstate(m);
4325 : if (!traverse_module_state) return 0;
4326 : Py_VISIT(traverse_module_state->__pyx_d);
4327 : Py_VISIT(traverse_module_state->__pyx_b);
4328 : Py_VISIT(traverse_module_state->__pyx_cython_runtime);
4329 : Py_VISIT(traverse_module_state->__pyx_empty_tuple);
4330 : Py_VISIT(traverse_module_state->__pyx_empty_bytes);
4331 : Py_VISIT(traverse_module_state->__pyx_empty_unicode);
4332 : #ifdef __Pyx_CyFunction_USED
4333 : Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
4334 : #endif
4335 : #ifdef __Pyx_FusedFunction_USED
4336 : Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
4337 : #endif
4338 : Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
4339 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
4340 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
4341 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
4342 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
4343 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
4344 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
4345 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
4346 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
4347 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
4348 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
4349 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
4350 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
4351 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
4352 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
4353 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
4354 : Py_VISIT(traverse_module_state->__pyx_array_type);
4355 : Py_VISIT(traverse_module_state->__pyx_type___pyx_array);
4356 : Py_VISIT(traverse_module_state->__pyx_MemviewEnum_type);
4357 : Py_VISIT(traverse_module_state->__pyx_type___pyx_MemviewEnum);
4358 : Py_VISIT(traverse_module_state->__pyx_memoryview_type);
4359 : Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryview);
4360 : Py_VISIT(traverse_module_state->__pyx_memoryviewslice_type);
4361 : Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryviewslice);
4362 : Py_VISIT(traverse_module_state->__pyx_kp_u_);
4363 : Py_VISIT(traverse_module_state->__pyx_n_s_ASCII);
4364 : Py_VISIT(traverse_module_state->__pyx_kp_s_All_dimensions_preceding_dimensi);
4365 : Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError);
4366 : Py_VISIT(traverse_module_state->__pyx_kp_s_Buffer_view_does_not_expose_stri);
4367 : Py_VISIT(traverse_module_state->__pyx_kp_s_Can_only_create_a_buffer_that_is);
4368 : Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_assign_to_read_only_memor);
4369 : Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_create_writable_memory_vi);
4370 : Py_VISIT(traverse_module_state->__pyx_kp_u_Cannot_index_with_type);
4371 : Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_transpose_memoryview_with);
4372 : Py_VISIT(traverse_module_state->__pyx_n_s_DTYPE);
4373 : Py_VISIT(traverse_module_state->__pyx_kp_s_Dimension_d_is_not_direct);
4374 : Py_VISIT(traverse_module_state->__pyx_n_s_Ellipsis);
4375 : Py_VISIT(traverse_module_state->__pyx_kp_s_Empty_shape_tuple_for_cython_arr);
4376 : Py_VISIT(traverse_module_state->__pyx_kp_s_Expected_at_least_d_argument_s_g);
4377 : Py_VISIT(traverse_module_state->__pyx_kp_s_Function_call_with_ambiguous_arg);
4378 : Py_VISIT(traverse_module_state->__pyx_n_s_ITYPE);
4379 : Py_VISIT(traverse_module_state->__pyx_n_s_ImportError);
4380 : Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
4381 : Py_VISIT(traverse_module_state->__pyx_n_s_IndexError);
4382 : Py_VISIT(traverse_module_state->__pyx_kp_s_Index_out_of_bounds_axis_d);
4383 : Py_VISIT(traverse_module_state->__pyx_kp_s_Indirect_dimensions_not_supporte);
4384 : Py_VISIT(traverse_module_state->__pyx_kp_u_Input_graph_must_be_sparse);
4385 : Py_VISIT(traverse_module_state->__pyx_kp_u_Input_matrix_should_be_in_CSC_CS);
4386 : Py_VISIT(traverse_module_state->__pyx_kp_u_Input_must_be_in_CSC_or_CSR_spar);
4387 : Py_VISIT(traverse_module_state->__pyx_kp_u_Input_must_be_sparse);
4388 : Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_mode_expected_c_or_fortr);
4389 : Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_shape_in_axis);
4390 : Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError);
4391 : Py_VISIT(traverse_module_state->__pyx_kp_s_MemoryView_of_r_at_0x_x);
4392 : Py_VISIT(traverse_module_state->__pyx_kp_s_MemoryView_of_r_object);
4393 : Py_VISIT(traverse_module_state->__pyx_n_s_N);
4394 : Py_VISIT(traverse_module_state->__pyx_n_s_N_old);
4395 : Py_VISIT(traverse_module_state->__pyx_kp_s_No_matching_signature_found);
4396 : Py_VISIT(traverse_module_state->__pyx_n_b_O);
4397 : Py_VISIT(traverse_module_state->__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
4398 : Py_VISIT(traverse_module_state->__pyx_n_s_PickleError);
4399 : Py_VISIT(traverse_module_state->__pyx_n_s_Sequence);
4400 : Py_VISIT(traverse_module_state->__pyx_n_s_SparseEfficiencyWarning);
4401 : Py_VISIT(traverse_module_state->__pyx_kp_s_Step_may_not_be_zero_axis_d);
4402 : Py_VISIT(traverse_module_state->__pyx_n_s_T);
4403 : Py_VISIT(traverse_module_state->__pyx_n_s_TypeError);
4404 : Py_VISIT(traverse_module_state->__pyx_kp_s_Unable_to_convert_item_to_object);
4405 : Py_VISIT(traverse_module_state->__pyx_n_s_ValueError);
4406 : Py_VISIT(traverse_module_state->__pyx_n_s_View_MemoryView);
4407 : Py_VISIT(traverse_module_state->__pyx_kp_s__13);
4408 : Py_VISIT(traverse_module_state->__pyx_kp_s__14);
4409 : Py_VISIT(traverse_module_state->__pyx_kp_u__14);
4410 : Py_VISIT(traverse_module_state->__pyx_kp_u__2);
4411 : Py_VISIT(traverse_module_state->__pyx_n_s__3);
4412 : Py_VISIT(traverse_module_state->__pyx_n_s__30);
4413 : Py_VISIT(traverse_module_state->__pyx_n_s__38);
4414 : Py_VISIT(traverse_module_state->__pyx_kp_u__6);
4415 : Py_VISIT(traverse_module_state->__pyx_kp_u__7);
4416 : Py_VISIT(traverse_module_state->__pyx_n_s_abc);
4417 : Py_VISIT(traverse_module_state->__pyx_n_s_allocate_buffer);
4418 : Py_VISIT(traverse_module_state->__pyx_kp_u_and);
4419 : Py_VISIT(traverse_module_state->__pyx_n_s_args);
4420 : Py_VISIT(traverse_module_state->__pyx_n_s_argsort);
4421 : Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
4422 : Py_VISIT(traverse_module_state->__pyx_n_s_base);
4423 : Py_VISIT(traverse_module_state->__pyx_n_s_c);
4424 : Py_VISIT(traverse_module_state->__pyx_n_u_c);
4425 : Py_VISIT(traverse_module_state->__pyx_n_s_class);
4426 : Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem);
4427 : Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
4428 : Py_VISIT(traverse_module_state->__pyx_n_s_collections);
4429 : Py_VISIT(traverse_module_state->__pyx_kp_s_collections_abc);
4430 : Py_VISIT(traverse_module_state->__pyx_kp_s_contiguous_and_direct);
4431 : Py_VISIT(traverse_module_state->__pyx_kp_s_contiguous_and_indirect);
4432 : Py_VISIT(traverse_module_state->__pyx_n_s_convert_pydata_sparse_to_scipy);
4433 : Py_VISIT(traverse_module_state->__pyx_n_u_coo);
4434 : Py_VISIT(traverse_module_state->__pyx_n_s_count);
4435 : Py_VISIT(traverse_module_state->__pyx_n_u_csc);
4436 : Py_VISIT(traverse_module_state->__pyx_n_u_csr);
4437 : Py_VISIT(traverse_module_state->__pyx_n_s_csr_array);
4438 : Py_VISIT(traverse_module_state->__pyx_n_s_defaults);
4439 : Py_VISIT(traverse_module_state->__pyx_n_s_degree);
4440 : Py_VISIT(traverse_module_state->__pyx_n_s_dict);
4441 : Py_VISIT(traverse_module_state->__pyx_kp_u_disable);
4442 : Py_VISIT(traverse_module_state->__pyx_n_s_dtype);
4443 : Py_VISIT(traverse_module_state->__pyx_n_s_dtype_is_object);
4444 : Py_VISIT(traverse_module_state->__pyx_kp_u_enable);
4445 : Py_VISIT(traverse_module_state->__pyx_n_s_encode);
4446 : Py_VISIT(traverse_module_state->__pyx_n_s_enumerate);
4447 : Py_VISIT(traverse_module_state->__pyx_n_s_error);
4448 : Py_VISIT(traverse_module_state->__pyx_n_s_flags);
4449 : Py_VISIT(traverse_module_state->__pyx_n_s_float64);
4450 : Py_VISIT(traverse_module_state->__pyx_n_s_format);
4451 : Py_VISIT(traverse_module_state->__pyx_n_s_fortran);
4452 : Py_VISIT(traverse_module_state->__pyx_n_u_fortran);
4453 : Py_VISIT(traverse_module_state->__pyx_n_s_fused_sigindex);
4454 : Py_VISIT(traverse_module_state->__pyx_kp_u_gc);
4455 : Py_VISIT(traverse_module_state->__pyx_n_s_get);
4456 : Py_VISIT(traverse_module_state->__pyx_n_s_getstate);
4457 : Py_VISIT(traverse_module_state->__pyx_kp_u_got);
4458 : Py_VISIT(traverse_module_state->__pyx_kp_u_got_differing_extents_in_dimensi);
4459 : Py_VISIT(traverse_module_state->__pyx_n_s_graph);
4460 : Py_VISIT(traverse_module_state->__pyx_kp_s_home_czgdp18079_Quansight_scipy);
4461 : Py_VISIT(traverse_module_state->__pyx_n_s_i);
4462 : Py_VISIT(traverse_module_state->__pyx_n_s_id);
4463 : Py_VISIT(traverse_module_state->__pyx_n_s_ii);
4464 : Py_VISIT(traverse_module_state->__pyx_n_s_import);
4465 : Py_VISIT(traverse_module_state->__pyx_n_s_ind);
4466 : Py_VISIT(traverse_module_state->__pyx_n_s_index);
4467 : Py_VISIT(traverse_module_state->__pyx_n_s_indices);
4468 : Py_VISIT(traverse_module_state->__pyx_n_s_indptr);
4469 : Py_VISIT(traverse_module_state->__pyx_n_s_inds);
4470 : Py_VISIT(traverse_module_state->__pyx_n_s_initializing);
4471 : Py_VISIT(traverse_module_state->__pyx_n_s_int32);
4472 : Py_VISIT(traverse_module_state->__pyx_n_s_int32_t);
4473 : Py_VISIT(traverse_module_state->__pyx_n_s_int64_t);
4474 : Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
4475 : Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled);
4476 : Py_VISIT(traverse_module_state->__pyx_n_s_issparse);
4477 : Py_VISIT(traverse_module_state->__pyx_n_s_itemsize);
4478 : Py_VISIT(traverse_module_state->__pyx_kp_s_itemsize_0_for_cython_array);
4479 : Py_VISIT(traverse_module_state->__pyx_n_s_j);
4480 : Py_VISIT(traverse_module_state->__pyx_n_s_jj);
4481 : Py_VISIT(traverse_module_state->__pyx_n_s_kind);
4482 : Py_VISIT(traverse_module_state->__pyx_n_s_kk);
4483 : Py_VISIT(traverse_module_state->__pyx_n_s_kwargs);
4484 : Py_VISIT(traverse_module_state->__pyx_n_s_level_end);
4485 : Py_VISIT(traverse_module_state->__pyx_n_s_level_len);
4486 : Py_VISIT(traverse_module_state->__pyx_n_s_level_start);
4487 : Py_VISIT(traverse_module_state->__pyx_n_s_ll);
4488 : Py_VISIT(traverse_module_state->__pyx_n_s_main);
4489 : Py_VISIT(traverse_module_state->__pyx_n_s_max);
4490 : Py_VISIT(traverse_module_state->__pyx_n_s_maximum_bipartite_matching);
4491 : Py_VISIT(traverse_module_state->__pyx_n_s_memview);
4492 : Py_VISIT(traverse_module_state->__pyx_n_s_mode);
4493 : Py_VISIT(traverse_module_state->__pyx_n_s_name);
4494 : Py_VISIT(traverse_module_state->__pyx_n_s_name_2);
4495 : Py_VISIT(traverse_module_state->__pyx_n_s_ndim);
4496 : Py_VISIT(traverse_module_state->__pyx_n_s_new);
4497 : Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
4498 : Py_VISIT(traverse_module_state->__pyx_n_s_np);
4499 : Py_VISIT(traverse_module_state->__pyx_n_s_nrows);
4500 : Py_VISIT(traverse_module_state->__pyx_n_s_num_rows);
4501 : Py_VISIT(traverse_module_state->__pyx_n_s_numpy);
4502 : Py_VISIT(traverse_module_state->__pyx_kp_u_numpy__core_multiarray_failed_to);
4503 : Py_VISIT(traverse_module_state->__pyx_kp_u_numpy__core_umath_failed_to_impo);
4504 : Py_VISIT(traverse_module_state->__pyx_n_s_obj);
4505 : Py_VISIT(traverse_module_state->__pyx_n_s_order);
4506 : Py_VISIT(traverse_module_state->__pyx_n_s_pack);
4507 : Py_VISIT(traverse_module_state->__pyx_n_s_pickle);
4508 : Py_VISIT(traverse_module_state->__pyx_n_s_ptr);
4509 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError);
4510 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum);
4511 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result);
4512 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state);
4513 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type);
4514 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_Enum);
4515 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable);
4516 : Py_VISIT(traverse_module_state->__pyx_n_s_range);
4517 : Py_VISIT(traverse_module_state->__pyx_n_s_rank);
4518 : Py_VISIT(traverse_module_state->__pyx_n_s_reduce);
4519 : Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython);
4520 : Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex);
4521 : Py_VISIT(traverse_module_state->__pyx_n_s_register);
4522 : Py_VISIT(traverse_module_state->__pyx_n_s_rev_inds);
4523 : Py_VISIT(traverse_module_state->__pyx_n_s_reverse_cuthill_mckee);
4524 : Py_VISIT(traverse_module_state->__pyx_n_s_reverse_cuthill_mckee_2);
4525 : Py_VISIT(traverse_module_state->__pyx_kp_u_reverse_cuthill_mckee_graph_sym);
4526 : Py_VISIT(traverse_module_state->__pyx_kp_u_reverse_cuthill_mckee_line_16);
4527 : Py_VISIT(traverse_module_state->__pyx_n_s_s);
4528 : Py_VISIT(traverse_module_state->__pyx_n_s_scipy_sparse);
4529 : Py_VISIT(traverse_module_state->__pyx_n_s_scipy_sparse__sputils);
4530 : Py_VISIT(traverse_module_state->__pyx_n_s_scipy_sparse_csgraph__reordering);
4531 : Py_VISIT(traverse_module_state->__pyx_n_s_seed);
4532 : Py_VISIT(traverse_module_state->__pyx_n_s_setstate);
4533 : Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython);
4534 : Py_VISIT(traverse_module_state->__pyx_n_s_shape);
4535 : Py_VISIT(traverse_module_state->__pyx_n_s_signatures);
4536 : Py_VISIT(traverse_module_state->__pyx_n_s_size);
4537 : Py_VISIT(traverse_module_state->__pyx_n_s_spec);
4538 : Py_VISIT(traverse_module_state->__pyx_n_s_split);
4539 : Py_VISIT(traverse_module_state->__pyx_n_s_start);
4540 : Py_VISIT(traverse_module_state->__pyx_n_s_step);
4541 : Py_VISIT(traverse_module_state->__pyx_n_s_stop);
4542 : Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_direct);
4543 : Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_direct_or_indirect);
4544 : Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_indirect);
4545 : Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource);
4546 : Py_VISIT(traverse_module_state->__pyx_n_s_strip);
4547 : Py_VISIT(traverse_module_state->__pyx_n_s_struct);
4548 : Py_VISIT(traverse_module_state->__pyx_n_s_structural_rank);
4549 : Py_VISIT(traverse_module_state->__pyx_kp_u_structural_rank_graph_Compute_t);
4550 : Py_VISIT(traverse_module_state->__pyx_kp_u_structural_rank_line_177);
4551 : Py_VISIT(traverse_module_state->__pyx_n_s_sum);
4552 : Py_VISIT(traverse_module_state->__pyx_n_s_symmetric_mode);
4553 : Py_VISIT(traverse_module_state->__pyx_n_s_sys);
4554 : Py_VISIT(traverse_module_state->__pyx_n_s_temp);
4555 : Py_VISIT(traverse_module_state->__pyx_n_s_temp2);
4556 : Py_VISIT(traverse_module_state->__pyx_n_s_temp_degrees);
4557 : Py_VISIT(traverse_module_state->__pyx_n_s_test);
4558 : Py_VISIT(traverse_module_state->__pyx_n_s_tocsr);
4559 : Py_VISIT(traverse_module_state->__pyx_n_s_transpose);
4560 : Py_VISIT(traverse_module_state->__pyx_kp_s_unable_to_allocate_array_data);
4561 : Py_VISIT(traverse_module_state->__pyx_kp_s_unable_to_allocate_shape_and_str);
4562 : Py_VISIT(traverse_module_state->__pyx_n_s_unpack);
4563 : Py_VISIT(traverse_module_state->__pyx_n_s_update);
4564 : Py_VISIT(traverse_module_state->__pyx_n_s_values);
4565 : Py_VISIT(traverse_module_state->__pyx_n_s_version_info);
4566 : Py_VISIT(traverse_module_state->__pyx_n_s_warn);
4567 : Py_VISIT(traverse_module_state->__pyx_n_s_warnings);
4568 : Py_VISIT(traverse_module_state->__pyx_n_s_zeros);
4569 : Py_VISIT(traverse_module_state->__pyx_n_s_zz);
4570 : Py_VISIT(traverse_module_state->__pyx_int_0);
4571 : Py_VISIT(traverse_module_state->__pyx_int_1);
4572 : Py_VISIT(traverse_module_state->__pyx_int_3);
4573 : Py_VISIT(traverse_module_state->__pyx_int_112105877);
4574 : Py_VISIT(traverse_module_state->__pyx_int_136983863);
4575 : Py_VISIT(traverse_module_state->__pyx_int_184977713);
4576 : Py_VISIT(traverse_module_state->__pyx_int_neg_1);
4577 : Py_VISIT(traverse_module_state->__pyx_slice__5);
4578 : Py_VISIT(traverse_module_state->__pyx_tuple__4);
4579 : Py_VISIT(traverse_module_state->__pyx_tuple__8);
4580 : Py_VISIT(traverse_module_state->__pyx_tuple__9);
4581 : Py_VISIT(traverse_module_state->__pyx_slice__17);
4582 : Py_VISIT(traverse_module_state->__pyx_tuple__10);
4583 : Py_VISIT(traverse_module_state->__pyx_tuple__11);
4584 : Py_VISIT(traverse_module_state->__pyx_tuple__12);
4585 : Py_VISIT(traverse_module_state->__pyx_tuple__15);
4586 : Py_VISIT(traverse_module_state->__pyx_tuple__16);
4587 : Py_VISIT(traverse_module_state->__pyx_tuple__18);
4588 : Py_VISIT(traverse_module_state->__pyx_tuple__19);
4589 : Py_VISIT(traverse_module_state->__pyx_tuple__20);
4590 : Py_VISIT(traverse_module_state->__pyx_tuple__21);
4591 : Py_VISIT(traverse_module_state->__pyx_tuple__22);
4592 : Py_VISIT(traverse_module_state->__pyx_tuple__23);
4593 : Py_VISIT(traverse_module_state->__pyx_tuple__24);
4594 : Py_VISIT(traverse_module_state->__pyx_tuple__25);
4595 : Py_VISIT(traverse_module_state->__pyx_tuple__26);
4596 : Py_VISIT(traverse_module_state->__pyx_tuple__27);
4597 : Py_VISIT(traverse_module_state->__pyx_tuple__28);
4598 : Py_VISIT(traverse_module_state->__pyx_tuple__31);
4599 : Py_VISIT(traverse_module_state->__pyx_tuple__33);
4600 : Py_VISIT(traverse_module_state->__pyx_tuple__34);
4601 : Py_VISIT(traverse_module_state->__pyx_tuple__36);
4602 : Py_VISIT(traverse_module_state->__pyx_codeobj__29);
4603 : Py_VISIT(traverse_module_state->__pyx_codeobj__32);
4604 : Py_VISIT(traverse_module_state->__pyx_codeobj__35);
4605 : Py_VISIT(traverse_module_state->__pyx_codeobj__37);
4606 : return 0;
4607 : }
4608 : #endif
4609 : /* #### Code section: module_state_defines ### */
4610 : #define __pyx_d __pyx_mstate_global->__pyx_d
4611 : #define __pyx_b __pyx_mstate_global->__pyx_b
4612 : #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
4613 : #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
4614 : #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
4615 : #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
4616 : #ifdef __Pyx_CyFunction_USED
4617 : #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
4618 : #endif
4619 : #ifdef __Pyx_FusedFunction_USED
4620 : #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
4621 : #endif
4622 : #ifdef __Pyx_Generator_USED
4623 : #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType
4624 : #endif
4625 : #ifdef __Pyx_IterableCoroutine_USED
4626 : #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType
4627 : #endif
4628 : #ifdef __Pyx_Coroutine_USED
4629 : #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType
4630 : #endif
4631 : #ifdef __Pyx_Coroutine_USED
4632 : #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType
4633 : #endif
4634 : #if CYTHON_USE_MODULE_STATE
4635 : #endif
4636 : #if CYTHON_USE_MODULE_STATE
4637 : #endif
4638 : #if CYTHON_USE_MODULE_STATE
4639 : #endif
4640 : #if CYTHON_USE_MODULE_STATE
4641 : #endif
4642 : #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type
4643 : #if CYTHON_USE_MODULE_STATE
4644 : #endif
4645 : #if CYTHON_USE_MODULE_STATE
4646 : #endif
4647 : #if CYTHON_USE_MODULE_STATE
4648 : #endif
4649 : #if CYTHON_USE_MODULE_STATE
4650 : #endif
4651 : #if CYTHON_USE_MODULE_STATE
4652 : #endif
4653 : #define __pyx_ptype_5numpy_dtype __pyx_mstate_global->__pyx_ptype_5numpy_dtype
4654 : #define __pyx_ptype_5numpy_flatiter __pyx_mstate_global->__pyx_ptype_5numpy_flatiter
4655 : #define __pyx_ptype_5numpy_broadcast __pyx_mstate_global->__pyx_ptype_5numpy_broadcast
4656 : #define __pyx_ptype_5numpy_ndarray __pyx_mstate_global->__pyx_ptype_5numpy_ndarray
4657 : #define __pyx_ptype_5numpy_generic __pyx_mstate_global->__pyx_ptype_5numpy_generic
4658 : #define __pyx_ptype_5numpy_number __pyx_mstate_global->__pyx_ptype_5numpy_number
4659 : #define __pyx_ptype_5numpy_integer __pyx_mstate_global->__pyx_ptype_5numpy_integer
4660 : #define __pyx_ptype_5numpy_signedinteger __pyx_mstate_global->__pyx_ptype_5numpy_signedinteger
4661 : #define __pyx_ptype_5numpy_unsignedinteger __pyx_mstate_global->__pyx_ptype_5numpy_unsignedinteger
4662 : #define __pyx_ptype_5numpy_inexact __pyx_mstate_global->__pyx_ptype_5numpy_inexact
4663 : #define __pyx_ptype_5numpy_floating __pyx_mstate_global->__pyx_ptype_5numpy_floating
4664 : #define __pyx_ptype_5numpy_complexfloating __pyx_mstate_global->__pyx_ptype_5numpy_complexfloating
4665 : #define __pyx_ptype_5numpy_flexible __pyx_mstate_global->__pyx_ptype_5numpy_flexible
4666 : #define __pyx_ptype_5numpy_character __pyx_mstate_global->__pyx_ptype_5numpy_character
4667 : #define __pyx_ptype_5numpy_ufunc __pyx_mstate_global->__pyx_ptype_5numpy_ufunc
4668 : #if CYTHON_USE_MODULE_STATE
4669 : #define __pyx_type___pyx_array __pyx_mstate_global->__pyx_type___pyx_array
4670 : #define __pyx_type___pyx_MemviewEnum __pyx_mstate_global->__pyx_type___pyx_MemviewEnum
4671 : #define __pyx_type___pyx_memoryview __pyx_mstate_global->__pyx_type___pyx_memoryview
4672 : #define __pyx_type___pyx_memoryviewslice __pyx_mstate_global->__pyx_type___pyx_memoryviewslice
4673 : #endif
4674 : #define __pyx_array_type __pyx_mstate_global->__pyx_array_type
4675 : #define __pyx_MemviewEnum_type __pyx_mstate_global->__pyx_MemviewEnum_type
4676 : #define __pyx_memoryview_type __pyx_mstate_global->__pyx_memoryview_type
4677 : #define __pyx_memoryviewslice_type __pyx_mstate_global->__pyx_memoryviewslice_type
4678 : #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_
4679 : #define __pyx_n_s_ASCII __pyx_mstate_global->__pyx_n_s_ASCII
4680 : #define __pyx_kp_s_All_dimensions_preceding_dimensi __pyx_mstate_global->__pyx_kp_s_All_dimensions_preceding_dimensi
4681 : #define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError
4682 : #define __pyx_kp_s_Buffer_view_does_not_expose_stri __pyx_mstate_global->__pyx_kp_s_Buffer_view_does_not_expose_stri
4683 : #define __pyx_kp_s_Can_only_create_a_buffer_that_is __pyx_mstate_global->__pyx_kp_s_Can_only_create_a_buffer_that_is
4684 : #define __pyx_kp_s_Cannot_assign_to_read_only_memor __pyx_mstate_global->__pyx_kp_s_Cannot_assign_to_read_only_memor
4685 : #define __pyx_kp_s_Cannot_create_writable_memory_vi __pyx_mstate_global->__pyx_kp_s_Cannot_create_writable_memory_vi
4686 : #define __pyx_kp_u_Cannot_index_with_type __pyx_mstate_global->__pyx_kp_u_Cannot_index_with_type
4687 : #define __pyx_kp_s_Cannot_transpose_memoryview_with __pyx_mstate_global->__pyx_kp_s_Cannot_transpose_memoryview_with
4688 : #define __pyx_n_s_DTYPE __pyx_mstate_global->__pyx_n_s_DTYPE
4689 : #define __pyx_kp_s_Dimension_d_is_not_direct __pyx_mstate_global->__pyx_kp_s_Dimension_d_is_not_direct
4690 : #define __pyx_n_s_Ellipsis __pyx_mstate_global->__pyx_n_s_Ellipsis
4691 : #define __pyx_kp_s_Empty_shape_tuple_for_cython_arr __pyx_mstate_global->__pyx_kp_s_Empty_shape_tuple_for_cython_arr
4692 : #define __pyx_kp_s_Expected_at_least_d_argument_s_g __pyx_mstate_global->__pyx_kp_s_Expected_at_least_d_argument_s_g
4693 : #define __pyx_kp_s_Function_call_with_ambiguous_arg __pyx_mstate_global->__pyx_kp_s_Function_call_with_ambiguous_arg
4694 : #define __pyx_n_s_ITYPE __pyx_mstate_global->__pyx_n_s_ITYPE
4695 : #define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError
4696 : #define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0
4697 : #define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError
4698 : #define __pyx_kp_s_Index_out_of_bounds_axis_d __pyx_mstate_global->__pyx_kp_s_Index_out_of_bounds_axis_d
4699 : #define __pyx_kp_s_Indirect_dimensions_not_supporte __pyx_mstate_global->__pyx_kp_s_Indirect_dimensions_not_supporte
4700 : #define __pyx_kp_u_Input_graph_must_be_sparse __pyx_mstate_global->__pyx_kp_u_Input_graph_must_be_sparse
4701 : #define __pyx_kp_u_Input_matrix_should_be_in_CSC_CS __pyx_mstate_global->__pyx_kp_u_Input_matrix_should_be_in_CSC_CS
4702 : #define __pyx_kp_u_Input_must_be_in_CSC_or_CSR_spar __pyx_mstate_global->__pyx_kp_u_Input_must_be_in_CSC_or_CSR_spar
4703 : #define __pyx_kp_u_Input_must_be_sparse __pyx_mstate_global->__pyx_kp_u_Input_must_be_sparse
4704 : #define __pyx_kp_u_Invalid_mode_expected_c_or_fortr __pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_c_or_fortr
4705 : #define __pyx_kp_u_Invalid_shape_in_axis __pyx_mstate_global->__pyx_kp_u_Invalid_shape_in_axis
4706 : #define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError
4707 : #define __pyx_kp_s_MemoryView_of_r_at_0x_x __pyx_mstate_global->__pyx_kp_s_MemoryView_of_r_at_0x_x
4708 : #define __pyx_kp_s_MemoryView_of_r_object __pyx_mstate_global->__pyx_kp_s_MemoryView_of_r_object
4709 : #define __pyx_n_s_N __pyx_mstate_global->__pyx_n_s_N
4710 : #define __pyx_n_s_N_old __pyx_mstate_global->__pyx_n_s_N_old
4711 : #define __pyx_kp_s_No_matching_signature_found __pyx_mstate_global->__pyx_kp_s_No_matching_signature_found
4712 : #define __pyx_n_b_O __pyx_mstate_global->__pyx_n_b_O
4713 : #define __pyx_kp_u_Out_of_bounds_on_buffer_access_a __pyx_mstate_global->__pyx_kp_u_Out_of_bounds_on_buffer_access_a
4714 : #define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError
4715 : #define __pyx_n_s_Sequence __pyx_mstate_global->__pyx_n_s_Sequence
4716 : #define __pyx_n_s_SparseEfficiencyWarning __pyx_mstate_global->__pyx_n_s_SparseEfficiencyWarning
4717 : #define __pyx_kp_s_Step_may_not_be_zero_axis_d __pyx_mstate_global->__pyx_kp_s_Step_may_not_be_zero_axis_d
4718 : #define __pyx_n_s_T __pyx_mstate_global->__pyx_n_s_T
4719 : #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError
4720 : #define __pyx_kp_s_Unable_to_convert_item_to_object __pyx_mstate_global->__pyx_kp_s_Unable_to_convert_item_to_object
4721 : #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError
4722 : #define __pyx_n_s_View_MemoryView __pyx_mstate_global->__pyx_n_s_View_MemoryView
4723 : #define __pyx_kp_s__13 __pyx_mstate_global->__pyx_kp_s__13
4724 : #define __pyx_kp_s__14 __pyx_mstate_global->__pyx_kp_s__14
4725 : #define __pyx_kp_u__14 __pyx_mstate_global->__pyx_kp_u__14
4726 : #define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2
4727 : #define __pyx_n_s__3 __pyx_mstate_global->__pyx_n_s__3
4728 : #define __pyx_n_s__30 __pyx_mstate_global->__pyx_n_s__30
4729 : #define __pyx_n_s__38 __pyx_mstate_global->__pyx_n_s__38
4730 : #define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6
4731 : #define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7
4732 : #define __pyx_n_s_abc __pyx_mstate_global->__pyx_n_s_abc
4733 : #define __pyx_n_s_allocate_buffer __pyx_mstate_global->__pyx_n_s_allocate_buffer
4734 : #define __pyx_kp_u_and __pyx_mstate_global->__pyx_kp_u_and
4735 : #define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args
4736 : #define __pyx_n_s_argsort __pyx_mstate_global->__pyx_n_s_argsort
4737 : #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
4738 : #define __pyx_n_s_base __pyx_mstate_global->__pyx_n_s_base
4739 : #define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c
4740 : #define __pyx_n_u_c __pyx_mstate_global->__pyx_n_u_c
4741 : #define __pyx_n_s_class __pyx_mstate_global->__pyx_n_s_class
4742 : #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem
4743 : #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
4744 : #define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections
4745 : #define __pyx_kp_s_collections_abc __pyx_mstate_global->__pyx_kp_s_collections_abc
4746 : #define __pyx_kp_s_contiguous_and_direct __pyx_mstate_global->__pyx_kp_s_contiguous_and_direct
4747 : #define __pyx_kp_s_contiguous_and_indirect __pyx_mstate_global->__pyx_kp_s_contiguous_and_indirect
4748 : #define __pyx_n_s_convert_pydata_sparse_to_scipy __pyx_mstate_global->__pyx_n_s_convert_pydata_sparse_to_scipy
4749 : #define __pyx_n_u_coo __pyx_mstate_global->__pyx_n_u_coo
4750 : #define __pyx_n_s_count __pyx_mstate_global->__pyx_n_s_count
4751 : #define __pyx_n_u_csc __pyx_mstate_global->__pyx_n_u_csc
4752 : #define __pyx_n_u_csr __pyx_mstate_global->__pyx_n_u_csr
4753 : #define __pyx_n_s_csr_array __pyx_mstate_global->__pyx_n_s_csr_array
4754 : #define __pyx_n_s_defaults __pyx_mstate_global->__pyx_n_s_defaults
4755 : #define __pyx_n_s_degree __pyx_mstate_global->__pyx_n_s_degree
4756 : #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict
4757 : #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable
4758 : #define __pyx_n_s_dtype __pyx_mstate_global->__pyx_n_s_dtype
4759 : #define __pyx_n_s_dtype_is_object __pyx_mstate_global->__pyx_n_s_dtype_is_object
4760 : #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable
4761 : #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode
4762 : #define __pyx_n_s_enumerate __pyx_mstate_global->__pyx_n_s_enumerate
4763 : #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error
4764 : #define __pyx_n_s_flags __pyx_mstate_global->__pyx_n_s_flags
4765 : #define __pyx_n_s_float64 __pyx_mstate_global->__pyx_n_s_float64
4766 : #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format
4767 : #define __pyx_n_s_fortran __pyx_mstate_global->__pyx_n_s_fortran
4768 : #define __pyx_n_u_fortran __pyx_mstate_global->__pyx_n_u_fortran
4769 : #define __pyx_n_s_fused_sigindex __pyx_mstate_global->__pyx_n_s_fused_sigindex
4770 : #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc
4771 : #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get
4772 : #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate
4773 : #define __pyx_kp_u_got __pyx_mstate_global->__pyx_kp_u_got
4774 : #define __pyx_kp_u_got_differing_extents_in_dimensi __pyx_mstate_global->__pyx_kp_u_got_differing_extents_in_dimensi
4775 : #define __pyx_n_s_graph __pyx_mstate_global->__pyx_n_s_graph
4776 : #define __pyx_kp_s_home_czgdp18079_Quansight_scipy __pyx_mstate_global->__pyx_kp_s_home_czgdp18079_Quansight_scipy
4777 : #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i
4778 : #define __pyx_n_s_id __pyx_mstate_global->__pyx_n_s_id
4779 : #define __pyx_n_s_ii __pyx_mstate_global->__pyx_n_s_ii
4780 : #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
4781 : #define __pyx_n_s_ind __pyx_mstate_global->__pyx_n_s_ind
4782 : #define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index
4783 : #define __pyx_n_s_indices __pyx_mstate_global->__pyx_n_s_indices
4784 : #define __pyx_n_s_indptr __pyx_mstate_global->__pyx_n_s_indptr
4785 : #define __pyx_n_s_inds __pyx_mstate_global->__pyx_n_s_inds
4786 : #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing
4787 : #define __pyx_n_s_int32 __pyx_mstate_global->__pyx_n_s_int32
4788 : #define __pyx_n_s_int32_t __pyx_mstate_global->__pyx_n_s_int32_t
4789 : #define __pyx_n_s_int64_t __pyx_mstate_global->__pyx_n_s_int64_t
4790 : #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
4791 : #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled
4792 : #define __pyx_n_s_issparse __pyx_mstate_global->__pyx_n_s_issparse
4793 : #define __pyx_n_s_itemsize __pyx_mstate_global->__pyx_n_s_itemsize
4794 : #define __pyx_kp_s_itemsize_0_for_cython_array __pyx_mstate_global->__pyx_kp_s_itemsize_0_for_cython_array
4795 : #define __pyx_n_s_j __pyx_mstate_global->__pyx_n_s_j
4796 : #define __pyx_n_s_jj __pyx_mstate_global->__pyx_n_s_jj
4797 : #define __pyx_n_s_kind __pyx_mstate_global->__pyx_n_s_kind
4798 : #define __pyx_n_s_kk __pyx_mstate_global->__pyx_n_s_kk
4799 : #define __pyx_n_s_kwargs __pyx_mstate_global->__pyx_n_s_kwargs
4800 : #define __pyx_n_s_level_end __pyx_mstate_global->__pyx_n_s_level_end
4801 : #define __pyx_n_s_level_len __pyx_mstate_global->__pyx_n_s_level_len
4802 : #define __pyx_n_s_level_start __pyx_mstate_global->__pyx_n_s_level_start
4803 : #define __pyx_n_s_ll __pyx_mstate_global->__pyx_n_s_ll
4804 : #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
4805 : #define __pyx_n_s_max __pyx_mstate_global->__pyx_n_s_max
4806 : #define __pyx_n_s_maximum_bipartite_matching __pyx_mstate_global->__pyx_n_s_maximum_bipartite_matching
4807 : #define __pyx_n_s_memview __pyx_mstate_global->__pyx_n_s_memview
4808 : #define __pyx_n_s_mode __pyx_mstate_global->__pyx_n_s_mode
4809 : #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
4810 : #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2
4811 : #define __pyx_n_s_ndim __pyx_mstate_global->__pyx_n_s_ndim
4812 : #define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new
4813 : #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non
4814 : #define __pyx_n_s_np __pyx_mstate_global->__pyx_n_s_np
4815 : #define __pyx_n_s_nrows __pyx_mstate_global->__pyx_n_s_nrows
4816 : #define __pyx_n_s_num_rows __pyx_mstate_global->__pyx_n_s_num_rows
4817 : #define __pyx_n_s_numpy __pyx_mstate_global->__pyx_n_s_numpy
4818 : #define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to
4819 : #define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo
4820 : #define __pyx_n_s_obj __pyx_mstate_global->__pyx_n_s_obj
4821 : #define __pyx_n_s_order __pyx_mstate_global->__pyx_n_s_order
4822 : #define __pyx_n_s_pack __pyx_mstate_global->__pyx_n_s_pack
4823 : #define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle
4824 : #define __pyx_n_s_ptr __pyx_mstate_global->__pyx_n_s_ptr
4825 : #define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError
4826 : #define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum
4827 : #define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result
4828 : #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state
4829 : #define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type
4830 : #define __pyx_n_s_pyx_unpickle_Enum __pyx_mstate_global->__pyx_n_s_pyx_unpickle_Enum
4831 : #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable
4832 : #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range
4833 : #define __pyx_n_s_rank __pyx_mstate_global->__pyx_n_s_rank
4834 : #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce
4835 : #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython
4836 : #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex
4837 : #define __pyx_n_s_register __pyx_mstate_global->__pyx_n_s_register
4838 : #define __pyx_n_s_rev_inds __pyx_mstate_global->__pyx_n_s_rev_inds
4839 : #define __pyx_n_s_reverse_cuthill_mckee __pyx_mstate_global->__pyx_n_s_reverse_cuthill_mckee
4840 : #define __pyx_n_s_reverse_cuthill_mckee_2 __pyx_mstate_global->__pyx_n_s_reverse_cuthill_mckee_2
4841 : #define __pyx_kp_u_reverse_cuthill_mckee_graph_sym __pyx_mstate_global->__pyx_kp_u_reverse_cuthill_mckee_graph_sym
4842 : #define __pyx_kp_u_reverse_cuthill_mckee_line_16 __pyx_mstate_global->__pyx_kp_u_reverse_cuthill_mckee_line_16
4843 : #define __pyx_n_s_s __pyx_mstate_global->__pyx_n_s_s
4844 : #define __pyx_n_s_scipy_sparse __pyx_mstate_global->__pyx_n_s_scipy_sparse
4845 : #define __pyx_n_s_scipy_sparse__sputils __pyx_mstate_global->__pyx_n_s_scipy_sparse__sputils
4846 : #define __pyx_n_s_scipy_sparse_csgraph__reordering __pyx_mstate_global->__pyx_n_s_scipy_sparse_csgraph__reordering
4847 : #define __pyx_n_s_seed __pyx_mstate_global->__pyx_n_s_seed
4848 : #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate
4849 : #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython
4850 : #define __pyx_n_s_shape __pyx_mstate_global->__pyx_n_s_shape
4851 : #define __pyx_n_s_signatures __pyx_mstate_global->__pyx_n_s_signatures
4852 : #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size
4853 : #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec
4854 : #define __pyx_n_s_split __pyx_mstate_global->__pyx_n_s_split
4855 : #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start
4856 : #define __pyx_n_s_step __pyx_mstate_global->__pyx_n_s_step
4857 : #define __pyx_n_s_stop __pyx_mstate_global->__pyx_n_s_stop
4858 : #define __pyx_kp_s_strided_and_direct __pyx_mstate_global->__pyx_kp_s_strided_and_direct
4859 : #define __pyx_kp_s_strided_and_direct_or_indirect __pyx_mstate_global->__pyx_kp_s_strided_and_direct_or_indirect
4860 : #define __pyx_kp_s_strided_and_indirect __pyx_mstate_global->__pyx_kp_s_strided_and_indirect
4861 : #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource
4862 : #define __pyx_n_s_strip __pyx_mstate_global->__pyx_n_s_strip
4863 : #define __pyx_n_s_struct __pyx_mstate_global->__pyx_n_s_struct
4864 : #define __pyx_n_s_structural_rank __pyx_mstate_global->__pyx_n_s_structural_rank
4865 : #define __pyx_kp_u_structural_rank_graph_Compute_t __pyx_mstate_global->__pyx_kp_u_structural_rank_graph_Compute_t
4866 : #define __pyx_kp_u_structural_rank_line_177 __pyx_mstate_global->__pyx_kp_u_structural_rank_line_177
4867 : #define __pyx_n_s_sum __pyx_mstate_global->__pyx_n_s_sum
4868 : #define __pyx_n_s_symmetric_mode __pyx_mstate_global->__pyx_n_s_symmetric_mode
4869 : #define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys
4870 : #define __pyx_n_s_temp __pyx_mstate_global->__pyx_n_s_temp
4871 : #define __pyx_n_s_temp2 __pyx_mstate_global->__pyx_n_s_temp2
4872 : #define __pyx_n_s_temp_degrees __pyx_mstate_global->__pyx_n_s_temp_degrees
4873 : #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
4874 : #define __pyx_n_s_tocsr __pyx_mstate_global->__pyx_n_s_tocsr
4875 : #define __pyx_n_s_transpose __pyx_mstate_global->__pyx_n_s_transpose
4876 : #define __pyx_kp_s_unable_to_allocate_array_data __pyx_mstate_global->__pyx_kp_s_unable_to_allocate_array_data
4877 : #define __pyx_kp_s_unable_to_allocate_shape_and_str __pyx_mstate_global->__pyx_kp_s_unable_to_allocate_shape_and_str
4878 : #define __pyx_n_s_unpack __pyx_mstate_global->__pyx_n_s_unpack
4879 : #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update
4880 : #define __pyx_n_s_values __pyx_mstate_global->__pyx_n_s_values
4881 : #define __pyx_n_s_version_info __pyx_mstate_global->__pyx_n_s_version_info
4882 : #define __pyx_n_s_warn __pyx_mstate_global->__pyx_n_s_warn
4883 : #define __pyx_n_s_warnings __pyx_mstate_global->__pyx_n_s_warnings
4884 : #define __pyx_n_s_zeros __pyx_mstate_global->__pyx_n_s_zeros
4885 : #define __pyx_n_s_zz __pyx_mstate_global->__pyx_n_s_zz
4886 : #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0
4887 : #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1
4888 : #define __pyx_int_3 __pyx_mstate_global->__pyx_int_3
4889 : #define __pyx_int_112105877 __pyx_mstate_global->__pyx_int_112105877
4890 : #define __pyx_int_136983863 __pyx_mstate_global->__pyx_int_136983863
4891 : #define __pyx_int_184977713 __pyx_mstate_global->__pyx_int_184977713
4892 : #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1
4893 : #define __pyx_slice__5 __pyx_mstate_global->__pyx_slice__5
4894 : #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4
4895 : #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8
4896 : #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9
4897 : #define __pyx_slice__17 __pyx_mstate_global->__pyx_slice__17
4898 : #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10
4899 : #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11
4900 : #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12
4901 : #define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15
4902 : #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16
4903 : #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18
4904 : #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19
4905 : #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20
4906 : #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21
4907 : #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22
4908 : #define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23
4909 : #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24
4910 : #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25
4911 : #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26
4912 : #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27
4913 : #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28
4914 : #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31
4915 : #define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33
4916 : #define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34
4917 : #define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36
4918 : #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29
4919 : #define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32
4920 : #define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35
4921 : #define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37
4922 : /* #### Code section: module_code ### */
4923 :
4924 : /* "View.MemoryView":131
4925 : * cdef bint dtype_is_object
4926 : *
4927 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
4928 : * mode="c", bint allocate_buffer=True):
4929 : *
4930 : */
4931 :
4932 : /* Python wrapper */
4933 : static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4934 0 : static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4935 0 : PyObject *__pyx_v_shape = 0;
4936 0 : Py_ssize_t __pyx_v_itemsize;
4937 0 : PyObject *__pyx_v_format = 0;
4938 0 : PyObject *__pyx_v_mode = 0;
4939 0 : int __pyx_v_allocate_buffer;
4940 0 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
4941 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
4942 0 : PyObject* values[5] = {0,0,0,0,0};
4943 0 : int __pyx_lineno = 0;
4944 0 : const char *__pyx_filename = NULL;
4945 0 : int __pyx_clineno = 0;
4946 0 : int __pyx_r;
4947 : __Pyx_RefNannyDeclarations
4948 0 : __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
4949 : #if CYTHON_ASSUME_SAFE_MACROS
4950 0 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
4951 : #else
4952 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
4953 : #endif
4954 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
4955 : {
4956 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
4957 0 : values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_n_s_c));
4958 0 : if (__pyx_kwds) {
4959 0 : Py_ssize_t kw_args;
4960 0 : switch (__pyx_nargs) {
4961 0 : case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
4962 0 : CYTHON_FALLTHROUGH;
4963 0 : case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
4964 0 : CYTHON_FALLTHROUGH;
4965 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
4966 0 : CYTHON_FALLTHROUGH;
4967 0 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
4968 0 : CYTHON_FALLTHROUGH;
4969 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
4970 0 : CYTHON_FALLTHROUGH;
4971 0 : case 0: break;
4972 0 : default: goto __pyx_L5_argtuple_error;
4973 : }
4974 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
4975 0 : switch (__pyx_nargs) {
4976 0 : case 0:
4977 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_shape)) != 0)) {
4978 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
4979 0 : kw_args--;
4980 : }
4981 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
4982 0 : else goto __pyx_L5_argtuple_error;
4983 0 : CYTHON_FALLTHROUGH;
4984 : case 1:
4985 0 : if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_itemsize)) != 0)) {
4986 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
4987 0 : kw_args--;
4988 : }
4989 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
4990 : else {
4991 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 131, __pyx_L3_error)
4992 : }
4993 0 : CYTHON_FALLTHROUGH;
4994 : case 2:
4995 0 : if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_format)) != 0)) {
4996 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[2]);
4997 0 : kw_args--;
4998 : }
4999 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
5000 : else {
5001 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 131, __pyx_L3_error)
5002 : }
5003 0 : CYTHON_FALLTHROUGH;
5004 : case 3:
5005 0 : if (kw_args > 0) {
5006 0 : PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode);
5007 0 : if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
5008 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
5009 : }
5010 0 : CYTHON_FALLTHROUGH;
5011 : case 4:
5012 0 : if (kw_args > 0) {
5013 0 : PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_allocate_buffer);
5014 0 : if (value) { values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
5015 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
5016 : }
5017 : }
5018 0 : if (unlikely(kw_args > 0)) {
5019 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
5020 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(1, 131, __pyx_L3_error)
5021 : }
5022 : } else {
5023 0 : switch (__pyx_nargs) {
5024 0 : case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
5025 0 : CYTHON_FALLTHROUGH;
5026 0 : case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
5027 0 : CYTHON_FALLTHROUGH;
5028 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
5029 0 : values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
5030 0 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
5031 0 : break;
5032 0 : default: goto __pyx_L5_argtuple_error;
5033 : }
5034 : }
5035 0 : __pyx_v_shape = ((PyObject*)values[0]);
5036 0 : __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
5037 0 : __pyx_v_format = values[2];
5038 0 : __pyx_v_mode = values[3];
5039 0 : if (values[4]) {
5040 0 : __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 132, __pyx_L3_error)
5041 : } else {
5042 :
5043 : /* "View.MemoryView":132
5044 : *
5045 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
5046 : * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
5047 : *
5048 : * cdef int idx
5049 : */
5050 : __pyx_v_allocate_buffer = ((int)1);
5051 : }
5052 : }
5053 0 : goto __pyx_L6_skip;
5054 0 : __pyx_L5_argtuple_error:;
5055 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, __pyx_nargs); __PYX_ERR(1, 131, __pyx_L3_error)
5056 0 : __pyx_L6_skip:;
5057 0 : goto __pyx_L4_argument_unpacking_done;
5058 0 : __pyx_L3_error:;
5059 : {
5060 0 : Py_ssize_t __pyx_temp;
5061 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
5062 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
5063 : }
5064 : }
5065 0 : __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5066 0 : __Pyx_RefNannyFinishContext();
5067 0 : return -1;
5068 0 : __pyx_L4_argument_unpacking_done:;
5069 0 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 131, __pyx_L1_error)
5070 0 : if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
5071 0 : PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 131, __pyx_L1_error)
5072 : }
5073 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
5074 :
5075 : /* "View.MemoryView":131
5076 : * cdef bint dtype_is_object
5077 : *
5078 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
5079 : * mode="c", bint allocate_buffer=True):
5080 : *
5081 : */
5082 :
5083 : /* function exit code */
5084 0 : goto __pyx_L0;
5085 : __pyx_L1_error:;
5086 : __pyx_r = -1;
5087 0 : __pyx_L0:;
5088 : {
5089 0 : Py_ssize_t __pyx_temp;
5090 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
5091 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
5092 : }
5093 : }
5094 : __Pyx_RefNannyFinishContext();
5095 : return __pyx_r;
5096 : }
5097 :
5098 0 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
5099 0 : int __pyx_v_idx;
5100 0 : Py_ssize_t __pyx_v_dim;
5101 0 : char __pyx_v_order;
5102 0 : int __pyx_r;
5103 : __Pyx_RefNannyDeclarations
5104 0 : Py_ssize_t __pyx_t_1;
5105 0 : int __pyx_t_2;
5106 0 : int __pyx_t_3;
5107 0 : PyObject *__pyx_t_4 = NULL;
5108 0 : PyObject *__pyx_t_5 = NULL;
5109 0 : PyObject *__pyx_t_6 = NULL;
5110 0 : unsigned int __pyx_t_7;
5111 0 : char *__pyx_t_8;
5112 0 : int __pyx_t_9;
5113 0 : Py_ssize_t __pyx_t_10;
5114 0 : Py_UCS4 __pyx_t_11;
5115 0 : int __pyx_lineno = 0;
5116 0 : const char *__pyx_filename = NULL;
5117 0 : int __pyx_clineno = 0;
5118 0 : __Pyx_RefNannySetupContext("__cinit__", 0);
5119 0 : __Pyx_INCREF(__pyx_v_format);
5120 :
5121 : /* "View.MemoryView":137
5122 : * cdef Py_ssize_t dim
5123 : *
5124 : * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
5125 : * self.itemsize = itemsize
5126 : *
5127 : */
5128 0 : if (unlikely(__pyx_v_shape == Py_None)) {
5129 0 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
5130 0 : __PYX_ERR(1, 137, __pyx_L1_error)
5131 : }
5132 0 : __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 137, __pyx_L1_error)
5133 0 : __pyx_v_self->ndim = ((int)__pyx_t_1);
5134 :
5135 : /* "View.MemoryView":138
5136 : *
5137 : * self.ndim = <int> len(shape)
5138 : * self.itemsize = itemsize # <<<<<<<<<<<<<<
5139 : *
5140 : * if not self.ndim:
5141 : */
5142 0 : __pyx_v_self->itemsize = __pyx_v_itemsize;
5143 :
5144 : /* "View.MemoryView":140
5145 : * self.itemsize = itemsize
5146 : *
5147 : * if not self.ndim: # <<<<<<<<<<<<<<
5148 : * raise ValueError, "Empty shape tuple for cython.array"
5149 : *
5150 : */
5151 0 : __pyx_t_2 = (!(__pyx_v_self->ndim != 0));
5152 0 : if (unlikely(__pyx_t_2)) {
5153 :
5154 : /* "View.MemoryView":141
5155 : *
5156 : * if not self.ndim:
5157 : * raise ValueError, "Empty shape tuple for cython.array" # <<<<<<<<<<<<<<
5158 : *
5159 : * if itemsize <= 0:
5160 : */
5161 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Empty_shape_tuple_for_cython_arr, 0, 0);
5162 0 : __PYX_ERR(1, 141, __pyx_L1_error)
5163 :
5164 : /* "View.MemoryView":140
5165 : * self.itemsize = itemsize
5166 : *
5167 : * if not self.ndim: # <<<<<<<<<<<<<<
5168 : * raise ValueError, "Empty shape tuple for cython.array"
5169 : *
5170 : */
5171 : }
5172 :
5173 : /* "View.MemoryView":143
5174 : * raise ValueError, "Empty shape tuple for cython.array"
5175 : *
5176 : * if itemsize <= 0: # <<<<<<<<<<<<<<
5177 : * raise ValueError, "itemsize <= 0 for cython.array"
5178 : *
5179 : */
5180 0 : __pyx_t_2 = (__pyx_v_itemsize <= 0);
5181 0 : if (unlikely(__pyx_t_2)) {
5182 :
5183 : /* "View.MemoryView":144
5184 : *
5185 : * if itemsize <= 0:
5186 : * raise ValueError, "itemsize <= 0 for cython.array" # <<<<<<<<<<<<<<
5187 : *
5188 : * if not isinstance(format, bytes):
5189 : */
5190 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_itemsize_0_for_cython_array, 0, 0);
5191 0 : __PYX_ERR(1, 144, __pyx_L1_error)
5192 :
5193 : /* "View.MemoryView":143
5194 : * raise ValueError, "Empty shape tuple for cython.array"
5195 : *
5196 : * if itemsize <= 0: # <<<<<<<<<<<<<<
5197 : * raise ValueError, "itemsize <= 0 for cython.array"
5198 : *
5199 : */
5200 : }
5201 :
5202 : /* "View.MemoryView":146
5203 : * raise ValueError, "itemsize <= 0 for cython.array"
5204 : *
5205 : * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
5206 : * format = format.encode('ASCII')
5207 : * self._format = format # keep a reference to the byte string
5208 : */
5209 0 : __pyx_t_2 = PyBytes_Check(__pyx_v_format);
5210 0 : __pyx_t_3 = (!__pyx_t_2);
5211 0 : if (__pyx_t_3) {
5212 :
5213 : /* "View.MemoryView":147
5214 : *
5215 : * if not isinstance(format, bytes):
5216 : * format = format.encode('ASCII') # <<<<<<<<<<<<<<
5217 : * self._format = format # keep a reference to the byte string
5218 : * self.format = self._format
5219 : */
5220 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 147, __pyx_L1_error)
5221 0 : __Pyx_GOTREF(__pyx_t_5);
5222 0 : __pyx_t_6 = NULL;
5223 0 : __pyx_t_7 = 0;
5224 : #if CYTHON_UNPACK_METHODS
5225 0 : if (likely(PyMethod_Check(__pyx_t_5))) {
5226 0 : __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
5227 0 : if (likely(__pyx_t_6)) {
5228 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5229 0 : __Pyx_INCREF(__pyx_t_6);
5230 0 : __Pyx_INCREF(function);
5231 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
5232 : __pyx_t_7 = 1;
5233 : }
5234 : }
5235 : #endif
5236 : {
5237 0 : PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_n_s_ASCII};
5238 0 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
5239 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5240 0 : if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 147, __pyx_L1_error)
5241 0 : __Pyx_GOTREF(__pyx_t_4);
5242 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5243 : }
5244 0 : __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_4);
5245 : __pyx_t_4 = 0;
5246 :
5247 : /* "View.MemoryView":146
5248 : * raise ValueError, "itemsize <= 0 for cython.array"
5249 : *
5250 : * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
5251 : * format = format.encode('ASCII')
5252 : * self._format = format # keep a reference to the byte string
5253 : */
5254 : }
5255 :
5256 : /* "View.MemoryView":148
5257 : * if not isinstance(format, bytes):
5258 : * format = format.encode('ASCII')
5259 : * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
5260 : * self.format = self._format
5261 : *
5262 : */
5263 0 : if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_v_format))) __PYX_ERR(1, 148, __pyx_L1_error)
5264 0 : __pyx_t_4 = __pyx_v_format;
5265 0 : __Pyx_INCREF(__pyx_t_4);
5266 0 : __Pyx_GIVEREF(__pyx_t_4);
5267 0 : __Pyx_GOTREF(__pyx_v_self->_format);
5268 0 : __Pyx_DECREF(__pyx_v_self->_format);
5269 0 : __pyx_v_self->_format = ((PyObject*)__pyx_t_4);
5270 0 : __pyx_t_4 = 0;
5271 :
5272 : /* "View.MemoryView":149
5273 : * format = format.encode('ASCII')
5274 : * self._format = format # keep a reference to the byte string
5275 : * self.format = self._format # <<<<<<<<<<<<<<
5276 : *
5277 : *
5278 : */
5279 0 : if (unlikely(__pyx_v_self->_format == Py_None)) {
5280 0 : PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
5281 0 : __PYX_ERR(1, 149, __pyx_L1_error)
5282 : }
5283 0 : __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error)
5284 0 : __pyx_v_self->format = __pyx_t_8;
5285 :
5286 : /* "View.MemoryView":152
5287 : *
5288 : *
5289 : * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
5290 : * self._strides = self._shape + self.ndim
5291 : *
5292 : */
5293 0 : __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
5294 :
5295 : /* "View.MemoryView":153
5296 : *
5297 : * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
5298 : * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
5299 : *
5300 : * if not self._shape:
5301 : */
5302 0 : __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
5303 :
5304 : /* "View.MemoryView":155
5305 : * self._strides = self._shape + self.ndim
5306 : *
5307 : * if not self._shape: # <<<<<<<<<<<<<<
5308 : * raise MemoryError, "unable to allocate shape and strides."
5309 : *
5310 : */
5311 0 : __pyx_t_3 = (!(__pyx_v_self->_shape != 0));
5312 0 : if (unlikely(__pyx_t_3)) {
5313 :
5314 : /* "View.MemoryView":156
5315 : *
5316 : * if not self._shape:
5317 : * raise MemoryError, "unable to allocate shape and strides." # <<<<<<<<<<<<<<
5318 : *
5319 : *
5320 : */
5321 0 : __Pyx_Raise(__pyx_builtin_MemoryError, __pyx_kp_s_unable_to_allocate_shape_and_str, 0, 0);
5322 0 : __PYX_ERR(1, 156, __pyx_L1_error)
5323 :
5324 : /* "View.MemoryView":155
5325 : * self._strides = self._shape + self.ndim
5326 : *
5327 : * if not self._shape: # <<<<<<<<<<<<<<
5328 : * raise MemoryError, "unable to allocate shape and strides."
5329 : *
5330 : */
5331 : }
5332 :
5333 : /* "View.MemoryView":159
5334 : *
5335 : *
5336 : * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
5337 : * if dim <= 0:
5338 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5339 : */
5340 0 : __pyx_t_9 = 0;
5341 0 : __pyx_t_4 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_4);
5342 : __pyx_t_1 = 0;
5343 0 : for (;;) {
5344 0 : {
5345 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
5346 : #if !CYTHON_ASSUME_SAFE_MACROS
5347 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 159, __pyx_L1_error)
5348 : #endif
5349 0 : if (__pyx_t_1 >= __pyx_temp) break;
5350 : }
5351 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5352 0 : __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(1, 159, __pyx_L1_error)
5353 : #else
5354 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 159, __pyx_L1_error)
5355 : __Pyx_GOTREF(__pyx_t_5);
5356 : #endif
5357 0 : __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 159, __pyx_L1_error)
5358 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5359 0 : __pyx_v_dim = __pyx_t_10;
5360 0 : __pyx_v_idx = __pyx_t_9;
5361 0 : __pyx_t_9 = (__pyx_t_9 + 1);
5362 :
5363 : /* "View.MemoryView":160
5364 : *
5365 : * for idx, dim in enumerate(shape):
5366 : * if dim <= 0: # <<<<<<<<<<<<<<
5367 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5368 : * self._shape[idx] = dim
5369 : */
5370 0 : __pyx_t_3 = (__pyx_v_dim <= 0);
5371 0 : if (unlikely(__pyx_t_3)) {
5372 :
5373 : /* "View.MemoryView":161
5374 : * for idx, dim in enumerate(shape):
5375 : * if dim <= 0:
5376 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}." # <<<<<<<<<<<<<<
5377 : * self._shape[idx] = dim
5378 : *
5379 : */
5380 0 : __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 161, __pyx_L1_error)
5381 0 : __Pyx_GOTREF(__pyx_t_5);
5382 0 : __pyx_t_10 = 0;
5383 0 : __pyx_t_11 = 127;
5384 0 : __Pyx_INCREF(__pyx_kp_u_Invalid_shape_in_axis);
5385 0 : __pyx_t_10 += 22;
5386 0 : __Pyx_GIVEREF(__pyx_kp_u_Invalid_shape_in_axis);
5387 0 : PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Invalid_shape_in_axis);
5388 0 : __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
5389 0 : __Pyx_GOTREF(__pyx_t_6);
5390 0 : __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
5391 0 : __Pyx_GIVEREF(__pyx_t_6);
5392 0 : PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
5393 0 : __pyx_t_6 = 0;
5394 0 : __Pyx_INCREF(__pyx_kp_u_);
5395 0 : __pyx_t_10 += 2;
5396 0 : __Pyx_GIVEREF(__pyx_kp_u_);
5397 0 : PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_);
5398 0 : __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
5399 0 : __Pyx_GOTREF(__pyx_t_6);
5400 0 : __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
5401 0 : __Pyx_GIVEREF(__pyx_t_6);
5402 0 : PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_6);
5403 0 : __pyx_t_6 = 0;
5404 0 : __Pyx_INCREF(__pyx_kp_u__2);
5405 0 : __pyx_t_10 += 1;
5406 0 : __Pyx_GIVEREF(__pyx_kp_u__2);
5407 0 : PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u__2);
5408 0 : __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
5409 0 : __Pyx_GOTREF(__pyx_t_6);
5410 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5411 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_6, 0, 0);
5412 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5413 0 : __PYX_ERR(1, 161, __pyx_L1_error)
5414 :
5415 : /* "View.MemoryView":160
5416 : *
5417 : * for idx, dim in enumerate(shape):
5418 : * if dim <= 0: # <<<<<<<<<<<<<<
5419 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5420 : * self._shape[idx] = dim
5421 : */
5422 : }
5423 :
5424 : /* "View.MemoryView":162
5425 : * if dim <= 0:
5426 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5427 : * self._shape[idx] = dim # <<<<<<<<<<<<<<
5428 : *
5429 : * cdef char order
5430 : */
5431 0 : (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
5432 :
5433 : /* "View.MemoryView":159
5434 : *
5435 : *
5436 : * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
5437 : * if dim <= 0:
5438 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5439 : */
5440 : }
5441 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5442 :
5443 : /* "View.MemoryView":165
5444 : *
5445 : * cdef char order
5446 : * if mode == 'c': # <<<<<<<<<<<<<<
5447 : * order = b'C'
5448 : * self.mode = u'c'
5449 : */
5450 0 : __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 165, __pyx_L1_error)
5451 0 : if (__pyx_t_3) {
5452 :
5453 : /* "View.MemoryView":166
5454 : * cdef char order
5455 : * if mode == 'c':
5456 : * order = b'C' # <<<<<<<<<<<<<<
5457 : * self.mode = u'c'
5458 : * elif mode == 'fortran':
5459 : */
5460 0 : __pyx_v_order = 'C';
5461 :
5462 : /* "View.MemoryView":167
5463 : * if mode == 'c':
5464 : * order = b'C'
5465 : * self.mode = u'c' # <<<<<<<<<<<<<<
5466 : * elif mode == 'fortran':
5467 : * order = b'F'
5468 : */
5469 0 : __Pyx_INCREF(__pyx_n_u_c);
5470 0 : __Pyx_GIVEREF(__pyx_n_u_c);
5471 0 : __Pyx_GOTREF(__pyx_v_self->mode);
5472 0 : __Pyx_DECREF(__pyx_v_self->mode);
5473 0 : __pyx_v_self->mode = __pyx_n_u_c;
5474 :
5475 : /* "View.MemoryView":165
5476 : *
5477 : * cdef char order
5478 : * if mode == 'c': # <<<<<<<<<<<<<<
5479 : * order = b'C'
5480 : * self.mode = u'c'
5481 : */
5482 0 : goto __pyx_L11;
5483 : }
5484 :
5485 : /* "View.MemoryView":168
5486 : * order = b'C'
5487 : * self.mode = u'c'
5488 : * elif mode == 'fortran': # <<<<<<<<<<<<<<
5489 : * order = b'F'
5490 : * self.mode = u'fortran'
5491 : */
5492 0 : __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 168, __pyx_L1_error)
5493 0 : if (likely(__pyx_t_3)) {
5494 :
5495 : /* "View.MemoryView":169
5496 : * self.mode = u'c'
5497 : * elif mode == 'fortran':
5498 : * order = b'F' # <<<<<<<<<<<<<<
5499 : * self.mode = u'fortran'
5500 : * else:
5501 : */
5502 0 : __pyx_v_order = 'F';
5503 :
5504 : /* "View.MemoryView":170
5505 : * elif mode == 'fortran':
5506 : * order = b'F'
5507 : * self.mode = u'fortran' # <<<<<<<<<<<<<<
5508 : * else:
5509 : * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
5510 : */
5511 0 : __Pyx_INCREF(__pyx_n_u_fortran);
5512 0 : __Pyx_GIVEREF(__pyx_n_u_fortran);
5513 0 : __Pyx_GOTREF(__pyx_v_self->mode);
5514 0 : __Pyx_DECREF(__pyx_v_self->mode);
5515 0 : __pyx_v_self->mode = __pyx_n_u_fortran;
5516 :
5517 : /* "View.MemoryView":168
5518 : * order = b'C'
5519 : * self.mode = u'c'
5520 : * elif mode == 'fortran': # <<<<<<<<<<<<<<
5521 : * order = b'F'
5522 : * self.mode = u'fortran'
5523 : */
5524 0 : goto __pyx_L11;
5525 : }
5526 :
5527 : /* "View.MemoryView":172
5528 : * self.mode = u'fortran'
5529 : * else:
5530 : * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}" # <<<<<<<<<<<<<<
5531 : *
5532 : * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
5533 : */
5534 : /*else*/ {
5535 0 : __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_mode, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 172, __pyx_L1_error)
5536 0 : __Pyx_GOTREF(__pyx_t_4);
5537 0 : __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 172, __pyx_L1_error)
5538 0 : __Pyx_GOTREF(__pyx_t_6);
5539 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5540 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_6, 0, 0);
5541 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5542 0 : __PYX_ERR(1, 172, __pyx_L1_error)
5543 : }
5544 0 : __pyx_L11:;
5545 :
5546 : /* "View.MemoryView":174
5547 : * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
5548 : *
5549 : * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order) # <<<<<<<<<<<<<<
5550 : *
5551 : * self.free_data = allocate_buffer
5552 : */
5553 0 : __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
5554 :
5555 : /* "View.MemoryView":176
5556 : * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
5557 : *
5558 : * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
5559 : * self.dtype_is_object = format == b'O'
5560 : *
5561 : */
5562 0 : __pyx_v_self->free_data = __pyx_v_allocate_buffer;
5563 :
5564 : /* "View.MemoryView":177
5565 : *
5566 : * self.free_data = allocate_buffer
5567 : * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
5568 : *
5569 : * if allocate_buffer:
5570 : */
5571 0 : __pyx_t_6 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 177, __pyx_L1_error)
5572 0 : __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 177, __pyx_L1_error)
5573 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5574 0 : __pyx_v_self->dtype_is_object = __pyx_t_3;
5575 :
5576 : /* "View.MemoryView":179
5577 : * self.dtype_is_object = format == b'O'
5578 : *
5579 : * if allocate_buffer: # <<<<<<<<<<<<<<
5580 : * _allocate_buffer(self)
5581 : *
5582 : */
5583 0 : if (__pyx_v_allocate_buffer) {
5584 :
5585 : /* "View.MemoryView":180
5586 : *
5587 : * if allocate_buffer:
5588 : * _allocate_buffer(self) # <<<<<<<<<<<<<<
5589 : *
5590 : * @cname('getbuffer')
5591 : */
5592 0 : __pyx_t_9 = __pyx_array_allocate_buffer(__pyx_v_self); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 180, __pyx_L1_error)
5593 :
5594 : /* "View.MemoryView":179
5595 : * self.dtype_is_object = format == b'O'
5596 : *
5597 : * if allocate_buffer: # <<<<<<<<<<<<<<
5598 : * _allocate_buffer(self)
5599 : *
5600 : */
5601 : }
5602 :
5603 : /* "View.MemoryView":131
5604 : * cdef bint dtype_is_object
5605 : *
5606 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
5607 : * mode="c", bint allocate_buffer=True):
5608 : *
5609 : */
5610 :
5611 : /* function exit code */
5612 0 : __pyx_r = 0;
5613 0 : goto __pyx_L0;
5614 0 : __pyx_L1_error:;
5615 0 : __Pyx_XDECREF(__pyx_t_4);
5616 0 : __Pyx_XDECREF(__pyx_t_5);
5617 0 : __Pyx_XDECREF(__pyx_t_6);
5618 0 : __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5619 0 : __pyx_r = -1;
5620 0 : __pyx_L0:;
5621 0 : __Pyx_XDECREF(__pyx_v_format);
5622 0 : __Pyx_RefNannyFinishContext();
5623 0 : return __pyx_r;
5624 : }
5625 :
5626 : /* "View.MemoryView":182
5627 : * _allocate_buffer(self)
5628 : *
5629 : * @cname('getbuffer') # <<<<<<<<<<<<<<
5630 : * def __getbuffer__(self, Py_buffer *info, int flags):
5631 : * cdef int bufmode = -1
5632 : */
5633 :
5634 : /* Python wrapper */
5635 : CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
5636 0 : CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5637 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5638 0 : int __pyx_r;
5639 : __Pyx_RefNannyDeclarations
5640 0 : __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
5641 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5642 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
5643 :
5644 : /* function exit code */
5645 0 : __Pyx_RefNannyFinishContext();
5646 0 : return __pyx_r;
5647 : }
5648 :
5649 0 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5650 0 : int __pyx_v_bufmode;
5651 0 : int __pyx_r;
5652 : __Pyx_RefNannyDeclarations
5653 0 : int __pyx_t_1;
5654 0 : char *__pyx_t_2;
5655 0 : Py_ssize_t __pyx_t_3;
5656 0 : int __pyx_t_4;
5657 0 : Py_ssize_t *__pyx_t_5;
5658 0 : int __pyx_lineno = 0;
5659 0 : const char *__pyx_filename = NULL;
5660 0 : int __pyx_clineno = 0;
5661 0 : if (unlikely(__pyx_v_info == NULL)) {
5662 0 : PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
5663 0 : return -1;
5664 : }
5665 0 : __Pyx_RefNannySetupContext("__getbuffer__", 0);
5666 0 : __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
5667 0 : __Pyx_GIVEREF(__pyx_v_info->obj);
5668 :
5669 : /* "View.MemoryView":184
5670 : * @cname('getbuffer')
5671 : * def __getbuffer__(self, Py_buffer *info, int flags):
5672 : * cdef int bufmode = -1 # <<<<<<<<<<<<<<
5673 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5674 : * if self.mode == u"c":
5675 : */
5676 0 : __pyx_v_bufmode = -1;
5677 :
5678 : /* "View.MemoryView":185
5679 : * def __getbuffer__(self, Py_buffer *info, int flags):
5680 : * cdef int bufmode = -1
5681 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
5682 : * if self.mode == u"c":
5683 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5684 : */
5685 0 : __pyx_t_1 = ((__pyx_v_flags & ((PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS) | PyBUF_ANY_CONTIGUOUS)) != 0);
5686 0 : if (__pyx_t_1) {
5687 :
5688 : /* "View.MemoryView":186
5689 : * cdef int bufmode = -1
5690 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5691 : * if self.mode == u"c": # <<<<<<<<<<<<<<
5692 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5693 : * elif self.mode == u"fortran":
5694 : */
5695 0 : __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 186, __pyx_L1_error)
5696 0 : if (__pyx_t_1) {
5697 :
5698 : /* "View.MemoryView":187
5699 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5700 : * if self.mode == u"c":
5701 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
5702 : * elif self.mode == u"fortran":
5703 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5704 : */
5705 0 : __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5706 :
5707 : /* "View.MemoryView":186
5708 : * cdef int bufmode = -1
5709 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5710 : * if self.mode == u"c": # <<<<<<<<<<<<<<
5711 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5712 : * elif self.mode == u"fortran":
5713 : */
5714 0 : goto __pyx_L4;
5715 : }
5716 :
5717 : /* "View.MemoryView":188
5718 : * if self.mode == u"c":
5719 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5720 : * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
5721 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5722 : * if not (flags & bufmode):
5723 : */
5724 0 : __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 188, __pyx_L1_error)
5725 0 : if (__pyx_t_1) {
5726 :
5727 : /* "View.MemoryView":189
5728 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5729 : * elif self.mode == u"fortran":
5730 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
5731 : * if not (flags & bufmode):
5732 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
5733 : */
5734 0 : __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5735 :
5736 : /* "View.MemoryView":188
5737 : * if self.mode == u"c":
5738 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5739 : * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
5740 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5741 : * if not (flags & bufmode):
5742 : */
5743 : }
5744 0 : __pyx_L4:;
5745 :
5746 : /* "View.MemoryView":190
5747 : * elif self.mode == u"fortran":
5748 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5749 : * if not (flags & bufmode): # <<<<<<<<<<<<<<
5750 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
5751 : * info.buf = self.data
5752 : */
5753 0 : __pyx_t_1 = (!((__pyx_v_flags & __pyx_v_bufmode) != 0));
5754 0 : if (unlikely(__pyx_t_1)) {
5755 :
5756 : /* "View.MemoryView":191
5757 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5758 : * if not (flags & bufmode):
5759 : * raise ValueError, "Can only create a buffer that is contiguous in memory." # <<<<<<<<<<<<<<
5760 : * info.buf = self.data
5761 : * info.len = self.len
5762 : */
5763 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Can_only_create_a_buffer_that_is, 0, 0);
5764 0 : __PYX_ERR(1, 191, __pyx_L1_error)
5765 :
5766 : /* "View.MemoryView":190
5767 : * elif self.mode == u"fortran":
5768 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5769 : * if not (flags & bufmode): # <<<<<<<<<<<<<<
5770 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
5771 : * info.buf = self.data
5772 : */
5773 : }
5774 :
5775 : /* "View.MemoryView":185
5776 : * def __getbuffer__(self, Py_buffer *info, int flags):
5777 : * cdef int bufmode = -1
5778 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
5779 : * if self.mode == u"c":
5780 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5781 : */
5782 : }
5783 :
5784 : /* "View.MemoryView":192
5785 : * if not (flags & bufmode):
5786 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
5787 : * info.buf = self.data # <<<<<<<<<<<<<<
5788 : * info.len = self.len
5789 : *
5790 : */
5791 0 : __pyx_t_2 = __pyx_v_self->data;
5792 0 : __pyx_v_info->buf = __pyx_t_2;
5793 :
5794 : /* "View.MemoryView":193
5795 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
5796 : * info.buf = self.data
5797 : * info.len = self.len # <<<<<<<<<<<<<<
5798 : *
5799 : * if flags & PyBUF_STRIDES:
5800 : */
5801 0 : __pyx_t_3 = __pyx_v_self->len;
5802 0 : __pyx_v_info->len = __pyx_t_3;
5803 :
5804 : /* "View.MemoryView":195
5805 : * info.len = self.len
5806 : *
5807 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
5808 : * info.ndim = self.ndim
5809 : * info.shape = self._shape
5810 : */
5811 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
5812 0 : if (__pyx_t_1) {
5813 :
5814 : /* "View.MemoryView":196
5815 : *
5816 : * if flags & PyBUF_STRIDES:
5817 : * info.ndim = self.ndim # <<<<<<<<<<<<<<
5818 : * info.shape = self._shape
5819 : * info.strides = self._strides
5820 : */
5821 0 : __pyx_t_4 = __pyx_v_self->ndim;
5822 0 : __pyx_v_info->ndim = __pyx_t_4;
5823 :
5824 : /* "View.MemoryView":197
5825 : * if flags & PyBUF_STRIDES:
5826 : * info.ndim = self.ndim
5827 : * info.shape = self._shape # <<<<<<<<<<<<<<
5828 : * info.strides = self._strides
5829 : * else:
5830 : */
5831 0 : __pyx_t_5 = __pyx_v_self->_shape;
5832 0 : __pyx_v_info->shape = __pyx_t_5;
5833 :
5834 : /* "View.MemoryView":198
5835 : * info.ndim = self.ndim
5836 : * info.shape = self._shape
5837 : * info.strides = self._strides # <<<<<<<<<<<<<<
5838 : * else:
5839 : * info.ndim = 1
5840 : */
5841 0 : __pyx_t_5 = __pyx_v_self->_strides;
5842 0 : __pyx_v_info->strides = __pyx_t_5;
5843 :
5844 : /* "View.MemoryView":195
5845 : * info.len = self.len
5846 : *
5847 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
5848 : * info.ndim = self.ndim
5849 : * info.shape = self._shape
5850 : */
5851 0 : goto __pyx_L6;
5852 : }
5853 :
5854 : /* "View.MemoryView":200
5855 : * info.strides = self._strides
5856 : * else:
5857 : * info.ndim = 1 # <<<<<<<<<<<<<<
5858 : * info.shape = &self.len if flags & PyBUF_ND else NULL
5859 : * info.strides = NULL
5860 : */
5861 : /*else*/ {
5862 0 : __pyx_v_info->ndim = 1;
5863 :
5864 : /* "View.MemoryView":201
5865 : * else:
5866 : * info.ndim = 1
5867 : * info.shape = &self.len if flags & PyBUF_ND else NULL # <<<<<<<<<<<<<<
5868 : * info.strides = NULL
5869 : *
5870 : */
5871 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
5872 0 : if (__pyx_t_1) {
5873 : __pyx_t_5 = (&__pyx_v_self->len);
5874 : } else {
5875 : __pyx_t_5 = NULL;
5876 : }
5877 0 : __pyx_v_info->shape = __pyx_t_5;
5878 :
5879 : /* "View.MemoryView":202
5880 : * info.ndim = 1
5881 : * info.shape = &self.len if flags & PyBUF_ND else NULL
5882 : * info.strides = NULL # <<<<<<<<<<<<<<
5883 : *
5884 : * info.suboffsets = NULL
5885 : */
5886 0 : __pyx_v_info->strides = NULL;
5887 : }
5888 0 : __pyx_L6:;
5889 :
5890 : /* "View.MemoryView":204
5891 : * info.strides = NULL
5892 : *
5893 : * info.suboffsets = NULL # <<<<<<<<<<<<<<
5894 : * info.itemsize = self.itemsize
5895 : * info.readonly = 0
5896 : */
5897 0 : __pyx_v_info->suboffsets = NULL;
5898 :
5899 : /* "View.MemoryView":205
5900 : *
5901 : * info.suboffsets = NULL
5902 : * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
5903 : * info.readonly = 0
5904 : * info.format = self.format if flags & PyBUF_FORMAT else NULL
5905 : */
5906 0 : __pyx_t_3 = __pyx_v_self->itemsize;
5907 0 : __pyx_v_info->itemsize = __pyx_t_3;
5908 :
5909 : /* "View.MemoryView":206
5910 : * info.suboffsets = NULL
5911 : * info.itemsize = self.itemsize
5912 : * info.readonly = 0 # <<<<<<<<<<<<<<
5913 : * info.format = self.format if flags & PyBUF_FORMAT else NULL
5914 : * info.obj = self
5915 : */
5916 0 : __pyx_v_info->readonly = 0;
5917 :
5918 : /* "View.MemoryView":207
5919 : * info.itemsize = self.itemsize
5920 : * info.readonly = 0
5921 : * info.format = self.format if flags & PyBUF_FORMAT else NULL # <<<<<<<<<<<<<<
5922 : * info.obj = self
5923 : *
5924 : */
5925 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
5926 0 : if (__pyx_t_1) {
5927 0 : __pyx_t_2 = __pyx_v_self->format;
5928 : } else {
5929 : __pyx_t_2 = NULL;
5930 : }
5931 0 : __pyx_v_info->format = __pyx_t_2;
5932 :
5933 : /* "View.MemoryView":208
5934 : * info.readonly = 0
5935 : * info.format = self.format if flags & PyBUF_FORMAT else NULL
5936 : * info.obj = self # <<<<<<<<<<<<<<
5937 : *
5938 : * def __dealloc__(array self):
5939 : */
5940 0 : __Pyx_INCREF((PyObject *)__pyx_v_self);
5941 0 : __Pyx_GIVEREF((PyObject *)__pyx_v_self);
5942 0 : __Pyx_GOTREF(__pyx_v_info->obj);
5943 0 : __Pyx_DECREF(__pyx_v_info->obj);
5944 0 : __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
5945 :
5946 : /* "View.MemoryView":182
5947 : * _allocate_buffer(self)
5948 : *
5949 : * @cname('getbuffer') # <<<<<<<<<<<<<<
5950 : * def __getbuffer__(self, Py_buffer *info, int flags):
5951 : * cdef int bufmode = -1
5952 : */
5953 :
5954 : /* function exit code */
5955 0 : __pyx_r = 0;
5956 0 : goto __pyx_L0;
5957 0 : __pyx_L1_error:;
5958 0 : __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5959 0 : __pyx_r = -1;
5960 0 : if (__pyx_v_info->obj != NULL) {
5961 0 : __Pyx_GOTREF(__pyx_v_info->obj);
5962 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5963 : }
5964 0 : goto __pyx_L2;
5965 0 : __pyx_L0:;
5966 0 : if (__pyx_v_info->obj == Py_None) {
5967 0 : __Pyx_GOTREF(__pyx_v_info->obj);
5968 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5969 : }
5970 0 : __pyx_L2:;
5971 : __Pyx_RefNannyFinishContext();
5972 : return __pyx_r;
5973 : }
5974 :
5975 : /* "View.MemoryView":210
5976 : * info.obj = self
5977 : *
5978 : * def __dealloc__(array self): # <<<<<<<<<<<<<<
5979 : * if self.callback_free_data != NULL:
5980 : * self.callback_free_data(self.data)
5981 : */
5982 :
5983 : /* Python wrapper */
5984 : static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
5985 0 : static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
5986 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5987 : __Pyx_RefNannyDeclarations
5988 0 : __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
5989 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5990 0 : __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
5991 :
5992 : /* function exit code */
5993 0 : __Pyx_RefNannyFinishContext();
5994 : }
5995 :
5996 0 : static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
5997 0 : int __pyx_t_1;
5998 0 : int __pyx_t_2;
5999 :
6000 : /* "View.MemoryView":211
6001 : *
6002 : * def __dealloc__(array self):
6003 : * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
6004 : * self.callback_free_data(self.data)
6005 : * elif self.free_data and self.data is not NULL:
6006 : */
6007 0 : __pyx_t_1 = (__pyx_v_self->callback_free_data != NULL);
6008 0 : if (__pyx_t_1) {
6009 :
6010 : /* "View.MemoryView":212
6011 : * def __dealloc__(array self):
6012 : * if self.callback_free_data != NULL:
6013 : * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
6014 : * elif self.free_data and self.data is not NULL:
6015 : * if self.dtype_is_object:
6016 : */
6017 0 : __pyx_v_self->callback_free_data(__pyx_v_self->data);
6018 :
6019 : /* "View.MemoryView":211
6020 : *
6021 : * def __dealloc__(array self):
6022 : * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
6023 : * self.callback_free_data(self.data)
6024 : * elif self.free_data and self.data is not NULL:
6025 : */
6026 0 : goto __pyx_L3;
6027 : }
6028 :
6029 : /* "View.MemoryView":213
6030 : * if self.callback_free_data != NULL:
6031 : * self.callback_free_data(self.data)
6032 : * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
6033 : * if self.dtype_is_object:
6034 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6035 : */
6036 0 : if (__pyx_v_self->free_data) {
6037 0 : } else {
6038 0 : __pyx_t_1 = __pyx_v_self->free_data;
6039 0 : goto __pyx_L4_bool_binop_done;
6040 : }
6041 0 : __pyx_t_2 = (__pyx_v_self->data != NULL);
6042 0 : __pyx_t_1 = __pyx_t_2;
6043 0 : __pyx_L4_bool_binop_done:;
6044 0 : if (__pyx_t_1) {
6045 :
6046 : /* "View.MemoryView":214
6047 : * self.callback_free_data(self.data)
6048 : * elif self.free_data and self.data is not NULL:
6049 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
6050 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6051 : * free(self.data)
6052 : */
6053 0 : if (__pyx_v_self->dtype_is_object) {
6054 :
6055 : /* "View.MemoryView":215
6056 : * elif self.free_data and self.data is not NULL:
6057 : * if self.dtype_is_object:
6058 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False) # <<<<<<<<<<<<<<
6059 : * free(self.data)
6060 : * PyObject_Free(self._shape)
6061 : */
6062 0 : __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
6063 :
6064 : /* "View.MemoryView":214
6065 : * self.callback_free_data(self.data)
6066 : * elif self.free_data and self.data is not NULL:
6067 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
6068 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6069 : * free(self.data)
6070 : */
6071 : }
6072 :
6073 : /* "View.MemoryView":216
6074 : * if self.dtype_is_object:
6075 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6076 : * free(self.data) # <<<<<<<<<<<<<<
6077 : * PyObject_Free(self._shape)
6078 : *
6079 : */
6080 0 : free(__pyx_v_self->data);
6081 :
6082 : /* "View.MemoryView":213
6083 : * if self.callback_free_data != NULL:
6084 : * self.callback_free_data(self.data)
6085 : * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
6086 : * if self.dtype_is_object:
6087 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6088 : */
6089 : }
6090 0 : __pyx_L3:;
6091 :
6092 : /* "View.MemoryView":217
6093 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6094 : * free(self.data)
6095 : * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
6096 : *
6097 : * @property
6098 : */
6099 0 : PyObject_Free(__pyx_v_self->_shape);
6100 :
6101 : /* "View.MemoryView":210
6102 : * info.obj = self
6103 : *
6104 : * def __dealloc__(array self): # <<<<<<<<<<<<<<
6105 : * if self.callback_free_data != NULL:
6106 : * self.callback_free_data(self.data)
6107 : */
6108 :
6109 : /* function exit code */
6110 0 : }
6111 :
6112 : /* "View.MemoryView":219
6113 : * PyObject_Free(self._shape)
6114 : *
6115 : * @property # <<<<<<<<<<<<<<
6116 : * def memview(self):
6117 : * return self.get_memview()
6118 : */
6119 :
6120 : /* Python wrapper */
6121 : static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
6122 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
6123 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6124 0 : PyObject *__pyx_r = 0;
6125 : __Pyx_RefNannyDeclarations
6126 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
6127 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6128 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
6129 :
6130 : /* function exit code */
6131 0 : __Pyx_RefNannyFinishContext();
6132 0 : return __pyx_r;
6133 : }
6134 :
6135 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
6136 0 : PyObject *__pyx_r = NULL;
6137 : __Pyx_RefNannyDeclarations
6138 0 : PyObject *__pyx_t_1 = NULL;
6139 0 : int __pyx_lineno = 0;
6140 0 : const char *__pyx_filename = NULL;
6141 0 : int __pyx_clineno = 0;
6142 0 : __Pyx_RefNannySetupContext("__get__", 1);
6143 :
6144 : /* "View.MemoryView":221
6145 : * @property
6146 : * def memview(self):
6147 : * return self.get_memview() # <<<<<<<<<<<<<<
6148 : *
6149 : * @cname('get_memview')
6150 : */
6151 0 : __Pyx_XDECREF(__pyx_r);
6152 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error)
6153 0 : __Pyx_GOTREF(__pyx_t_1);
6154 0 : __pyx_r = __pyx_t_1;
6155 0 : __pyx_t_1 = 0;
6156 0 : goto __pyx_L0;
6157 :
6158 : /* "View.MemoryView":219
6159 : * PyObject_Free(self._shape)
6160 : *
6161 : * @property # <<<<<<<<<<<<<<
6162 : * def memview(self):
6163 : * return self.get_memview()
6164 : */
6165 :
6166 : /* function exit code */
6167 0 : __pyx_L1_error:;
6168 0 : __Pyx_XDECREF(__pyx_t_1);
6169 0 : __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6170 0 : __pyx_r = NULL;
6171 0 : __pyx_L0:;
6172 0 : __Pyx_XGIVEREF(__pyx_r);
6173 0 : __Pyx_RefNannyFinishContext();
6174 0 : return __pyx_r;
6175 : }
6176 :
6177 : /* "View.MemoryView":224
6178 : *
6179 : * @cname('get_memview')
6180 : * cdef get_memview(self): # <<<<<<<<<<<<<<
6181 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
6182 : * return memoryview(self, flags, self.dtype_is_object)
6183 : */
6184 :
6185 0 : static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
6186 0 : int __pyx_v_flags;
6187 0 : PyObject *__pyx_r = NULL;
6188 : __Pyx_RefNannyDeclarations
6189 0 : PyObject *__pyx_t_1 = NULL;
6190 0 : PyObject *__pyx_t_2 = NULL;
6191 0 : PyObject *__pyx_t_3 = NULL;
6192 0 : int __pyx_lineno = 0;
6193 0 : const char *__pyx_filename = NULL;
6194 0 : int __pyx_clineno = 0;
6195 0 : __Pyx_RefNannySetupContext("get_memview", 1);
6196 :
6197 : /* "View.MemoryView":225
6198 : * @cname('get_memview')
6199 : * cdef get_memview(self):
6200 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
6201 : * return memoryview(self, flags, self.dtype_is_object)
6202 : *
6203 : */
6204 0 : __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
6205 :
6206 : /* "View.MemoryView":226
6207 : * cdef get_memview(self):
6208 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
6209 : * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
6210 : *
6211 : * def __len__(self):
6212 : */
6213 0 : __Pyx_XDECREF(__pyx_r);
6214 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error)
6215 0 : __Pyx_GOTREF(__pyx_t_1);
6216 0 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error)
6217 0 : __Pyx_GOTREF(__pyx_t_2);
6218 0 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __pyx_L1_error)
6219 0 : __Pyx_GOTREF(__pyx_t_3);
6220 0 : __Pyx_INCREF((PyObject *)__pyx_v_self);
6221 0 : __Pyx_GIVEREF((PyObject *)__pyx_v_self);
6222 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self))) __PYX_ERR(1, 226, __pyx_L1_error);
6223 0 : __Pyx_GIVEREF(__pyx_t_1);
6224 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error);
6225 0 : __Pyx_GIVEREF(__pyx_t_2);
6226 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error);
6227 0 : __pyx_t_1 = 0;
6228 0 : __pyx_t_2 = 0;
6229 0 : __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error)
6230 0 : __Pyx_GOTREF(__pyx_t_2);
6231 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6232 0 : __pyx_r = __pyx_t_2;
6233 0 : __pyx_t_2 = 0;
6234 0 : goto __pyx_L0;
6235 :
6236 : /* "View.MemoryView":224
6237 : *
6238 : * @cname('get_memview')
6239 : * cdef get_memview(self): # <<<<<<<<<<<<<<
6240 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
6241 : * return memoryview(self, flags, self.dtype_is_object)
6242 : */
6243 :
6244 : /* function exit code */
6245 0 : __pyx_L1_error:;
6246 0 : __Pyx_XDECREF(__pyx_t_1);
6247 0 : __Pyx_XDECREF(__pyx_t_2);
6248 0 : __Pyx_XDECREF(__pyx_t_3);
6249 0 : __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
6250 0 : __pyx_r = 0;
6251 0 : __pyx_L0:;
6252 0 : __Pyx_XGIVEREF(__pyx_r);
6253 0 : __Pyx_RefNannyFinishContext();
6254 0 : return __pyx_r;
6255 : }
6256 :
6257 : /* "View.MemoryView":228
6258 : * return memoryview(self, flags, self.dtype_is_object)
6259 : *
6260 : * def __len__(self): # <<<<<<<<<<<<<<
6261 : * return self._shape[0]
6262 : *
6263 : */
6264 :
6265 : /* Python wrapper */
6266 : static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
6267 0 : static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
6268 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6269 0 : Py_ssize_t __pyx_r;
6270 : __Pyx_RefNannyDeclarations
6271 0 : __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
6272 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6273 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
6274 :
6275 : /* function exit code */
6276 0 : __Pyx_RefNannyFinishContext();
6277 0 : return __pyx_r;
6278 : }
6279 :
6280 0 : static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
6281 0 : Py_ssize_t __pyx_r;
6282 :
6283 : /* "View.MemoryView":229
6284 : *
6285 : * def __len__(self):
6286 : * return self._shape[0] # <<<<<<<<<<<<<<
6287 : *
6288 : * def __getattr__(self, attr):
6289 : */
6290 0 : __pyx_r = (__pyx_v_self->_shape[0]);
6291 0 : goto __pyx_L0;
6292 :
6293 : /* "View.MemoryView":228
6294 : * return memoryview(self, flags, self.dtype_is_object)
6295 : *
6296 : * def __len__(self): # <<<<<<<<<<<<<<
6297 : * return self._shape[0]
6298 : *
6299 : */
6300 :
6301 : /* function exit code */
6302 0 : __pyx_L0:;
6303 0 : return __pyx_r;
6304 : }
6305 :
6306 : /* "View.MemoryView":231
6307 : * return self._shape[0]
6308 : *
6309 : * def __getattr__(self, attr): # <<<<<<<<<<<<<<
6310 : * return getattr(self.memview, attr)
6311 : *
6312 : */
6313 :
6314 : /* Python wrapper */
6315 : static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
6316 0 : static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
6317 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6318 0 : PyObject *__pyx_r = 0;
6319 : __Pyx_RefNannyDeclarations
6320 0 : __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
6321 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6322 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
6323 :
6324 : /* function exit code */
6325 0 : __Pyx_RefNannyFinishContext();
6326 0 : return __pyx_r;
6327 : }
6328 :
6329 0 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
6330 0 : PyObject *__pyx_r = NULL;
6331 : __Pyx_RefNannyDeclarations
6332 0 : PyObject *__pyx_t_1 = NULL;
6333 0 : PyObject *__pyx_t_2 = NULL;
6334 0 : int __pyx_lineno = 0;
6335 0 : const char *__pyx_filename = NULL;
6336 0 : int __pyx_clineno = 0;
6337 0 : __Pyx_RefNannySetupContext("__getattr__", 1);
6338 :
6339 : /* "View.MemoryView":232
6340 : *
6341 : * def __getattr__(self, attr):
6342 : * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
6343 : *
6344 : * def __getitem__(self, item):
6345 : */
6346 0 : __Pyx_XDECREF(__pyx_r);
6347 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 232, __pyx_L1_error)
6348 0 : __Pyx_GOTREF(__pyx_t_1);
6349 0 : __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 232, __pyx_L1_error)
6350 0 : __Pyx_GOTREF(__pyx_t_2);
6351 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6352 0 : __pyx_r = __pyx_t_2;
6353 0 : __pyx_t_2 = 0;
6354 0 : goto __pyx_L0;
6355 :
6356 : /* "View.MemoryView":231
6357 : * return self._shape[0]
6358 : *
6359 : * def __getattr__(self, attr): # <<<<<<<<<<<<<<
6360 : * return getattr(self.memview, attr)
6361 : *
6362 : */
6363 :
6364 : /* function exit code */
6365 0 : __pyx_L1_error:;
6366 0 : __Pyx_XDECREF(__pyx_t_1);
6367 0 : __Pyx_XDECREF(__pyx_t_2);
6368 0 : __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6369 0 : __pyx_r = NULL;
6370 0 : __pyx_L0:;
6371 0 : __Pyx_XGIVEREF(__pyx_r);
6372 0 : __Pyx_RefNannyFinishContext();
6373 0 : return __pyx_r;
6374 : }
6375 :
6376 : /* "View.MemoryView":234
6377 : * return getattr(self.memview, attr)
6378 : *
6379 : * def __getitem__(self, item): # <<<<<<<<<<<<<<
6380 : * return self.memview[item]
6381 : *
6382 : */
6383 :
6384 : /* Python wrapper */
6385 : static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
6386 0 : static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
6387 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6388 0 : PyObject *__pyx_r = 0;
6389 : __Pyx_RefNannyDeclarations
6390 0 : __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
6391 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6392 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
6393 :
6394 : /* function exit code */
6395 0 : __Pyx_RefNannyFinishContext();
6396 0 : return __pyx_r;
6397 : }
6398 :
6399 0 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
6400 0 : PyObject *__pyx_r = NULL;
6401 : __Pyx_RefNannyDeclarations
6402 0 : PyObject *__pyx_t_1 = NULL;
6403 0 : PyObject *__pyx_t_2 = NULL;
6404 0 : int __pyx_lineno = 0;
6405 0 : const char *__pyx_filename = NULL;
6406 0 : int __pyx_clineno = 0;
6407 0 : __Pyx_RefNannySetupContext("__getitem__", 1);
6408 :
6409 : /* "View.MemoryView":235
6410 : *
6411 : * def __getitem__(self, item):
6412 : * return self.memview[item] # <<<<<<<<<<<<<<
6413 : *
6414 : * def __setitem__(self, item, value):
6415 : */
6416 0 : __Pyx_XDECREF(__pyx_r);
6417 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error)
6418 0 : __Pyx_GOTREF(__pyx_t_1);
6419 0 : __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 235, __pyx_L1_error)
6420 0 : __Pyx_GOTREF(__pyx_t_2);
6421 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6422 0 : __pyx_r = __pyx_t_2;
6423 0 : __pyx_t_2 = 0;
6424 0 : goto __pyx_L0;
6425 :
6426 : /* "View.MemoryView":234
6427 : * return getattr(self.memview, attr)
6428 : *
6429 : * def __getitem__(self, item): # <<<<<<<<<<<<<<
6430 : * return self.memview[item]
6431 : *
6432 : */
6433 :
6434 : /* function exit code */
6435 0 : __pyx_L1_error:;
6436 0 : __Pyx_XDECREF(__pyx_t_1);
6437 0 : __Pyx_XDECREF(__pyx_t_2);
6438 0 : __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6439 0 : __pyx_r = NULL;
6440 0 : __pyx_L0:;
6441 0 : __Pyx_XGIVEREF(__pyx_r);
6442 0 : __Pyx_RefNannyFinishContext();
6443 0 : return __pyx_r;
6444 : }
6445 :
6446 : /* "View.MemoryView":237
6447 : * return self.memview[item]
6448 : *
6449 : * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
6450 : * self.memview[item] = value
6451 : *
6452 : */
6453 :
6454 : /* Python wrapper */
6455 : static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
6456 0 : static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
6457 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6458 0 : int __pyx_r;
6459 : __Pyx_RefNannyDeclarations
6460 0 : __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
6461 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6462 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
6463 :
6464 : /* function exit code */
6465 0 : __Pyx_RefNannyFinishContext();
6466 0 : return __pyx_r;
6467 : }
6468 :
6469 0 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
6470 0 : int __pyx_r;
6471 : __Pyx_RefNannyDeclarations
6472 0 : PyObject *__pyx_t_1 = NULL;
6473 0 : int __pyx_lineno = 0;
6474 0 : const char *__pyx_filename = NULL;
6475 0 : int __pyx_clineno = 0;
6476 0 : __Pyx_RefNannySetupContext("__setitem__", 1);
6477 :
6478 : /* "View.MemoryView":238
6479 : *
6480 : * def __setitem__(self, item, value):
6481 : * self.memview[item] = value # <<<<<<<<<<<<<<
6482 : *
6483 : *
6484 : */
6485 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 238, __pyx_L1_error)
6486 0 : __Pyx_GOTREF(__pyx_t_1);
6487 0 : if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0))) __PYX_ERR(1, 238, __pyx_L1_error)
6488 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6489 :
6490 : /* "View.MemoryView":237
6491 : * return self.memview[item]
6492 : *
6493 : * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
6494 : * self.memview[item] = value
6495 : *
6496 : */
6497 :
6498 : /* function exit code */
6499 0 : __pyx_r = 0;
6500 0 : goto __pyx_L0;
6501 0 : __pyx_L1_error:;
6502 0 : __Pyx_XDECREF(__pyx_t_1);
6503 0 : __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6504 0 : __pyx_r = -1;
6505 0 : __pyx_L0:;
6506 0 : __Pyx_RefNannyFinishContext();
6507 0 : return __pyx_r;
6508 : }
6509 :
6510 : /* "(tree fragment)":1
6511 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6512 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6513 : * def __setstate_cython__(self, __pyx_state):
6514 : */
6515 :
6516 : /* Python wrapper */
6517 : static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
6518 : #if CYTHON_METH_FASTCALL
6519 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6520 : #else
6521 : PyObject *__pyx_args, PyObject *__pyx_kwds
6522 : #endif
6523 : ); /*proto*/
6524 0 : static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
6525 : #if CYTHON_METH_FASTCALL
6526 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6527 : #else
6528 : PyObject *__pyx_args, PyObject *__pyx_kwds
6529 : #endif
6530 : ) {
6531 : #if !CYTHON_METH_FASTCALL
6532 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6533 : #endif
6534 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6535 0 : PyObject *__pyx_r = 0;
6536 : __Pyx_RefNannyDeclarations
6537 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6538 : #if !CYTHON_METH_FASTCALL
6539 : #if CYTHON_ASSUME_SAFE_MACROS
6540 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6541 : #else
6542 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6543 : #endif
6544 : #endif
6545 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6546 0 : if (unlikely(__pyx_nargs > 0)) {
6547 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
6548 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
6549 0 : __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
6550 :
6551 : /* function exit code */
6552 0 : __Pyx_RefNannyFinishContext();
6553 0 : return __pyx_r;
6554 : }
6555 :
6556 0 : static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
6557 0 : PyObject *__pyx_r = NULL;
6558 : __Pyx_RefNannyDeclarations
6559 0 : int __pyx_lineno = 0;
6560 0 : const char *__pyx_filename = NULL;
6561 0 : int __pyx_clineno = 0;
6562 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
6563 :
6564 : /* "(tree fragment)":2
6565 : * def __reduce_cython__(self):
6566 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
6567 : * def __setstate_cython__(self, __pyx_state):
6568 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6569 : */
6570 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
6571 0 : __PYX_ERR(1, 2, __pyx_L1_error)
6572 :
6573 : /* "(tree fragment)":1
6574 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6575 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6576 : * def __setstate_cython__(self, __pyx_state):
6577 : */
6578 :
6579 : /* function exit code */
6580 0 : __pyx_L1_error:;
6581 0 : __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6582 0 : __pyx_r = NULL;
6583 0 : __Pyx_XGIVEREF(__pyx_r);
6584 0 : __Pyx_RefNannyFinishContext();
6585 0 : return __pyx_r;
6586 : }
6587 :
6588 : /* "(tree fragment)":3
6589 : * def __reduce_cython__(self):
6590 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6591 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6592 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6593 : */
6594 :
6595 : /* Python wrapper */
6596 : static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
6597 : #if CYTHON_METH_FASTCALL
6598 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6599 : #else
6600 : PyObject *__pyx_args, PyObject *__pyx_kwds
6601 : #endif
6602 : ); /*proto*/
6603 0 : static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
6604 : #if CYTHON_METH_FASTCALL
6605 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6606 : #else
6607 : PyObject *__pyx_args, PyObject *__pyx_kwds
6608 : #endif
6609 : ) {
6610 0 : CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
6611 : #if !CYTHON_METH_FASTCALL
6612 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6613 : #endif
6614 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6615 0 : PyObject* values[1] = {0};
6616 0 : int __pyx_lineno = 0;
6617 0 : const char *__pyx_filename = NULL;
6618 0 : int __pyx_clineno = 0;
6619 0 : PyObject *__pyx_r = 0;
6620 : __Pyx_RefNannyDeclarations
6621 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6622 : #if !CYTHON_METH_FASTCALL
6623 : #if CYTHON_ASSUME_SAFE_MACROS
6624 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6625 : #else
6626 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6627 : #endif
6628 : #endif
6629 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6630 : {
6631 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
6632 0 : if (__pyx_kwds) {
6633 0 : Py_ssize_t kw_args;
6634 0 : switch (__pyx_nargs) {
6635 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
6636 0 : CYTHON_FALLTHROUGH;
6637 0 : case 0: break;
6638 0 : default: goto __pyx_L5_argtuple_error;
6639 : }
6640 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
6641 0 : switch (__pyx_nargs) {
6642 : case 0:
6643 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
6644 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
6645 0 : kw_args--;
6646 : }
6647 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
6648 0 : else goto __pyx_L5_argtuple_error;
6649 : }
6650 0 : if (unlikely(kw_args > 0)) {
6651 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
6652 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
6653 : }
6654 0 : } else if (unlikely(__pyx_nargs != 1)) {
6655 0 : goto __pyx_L5_argtuple_error;
6656 : } else {
6657 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
6658 : }
6659 0 : __pyx_v___pyx_state = values[0];
6660 : }
6661 0 : goto __pyx_L6_skip;
6662 0 : __pyx_L5_argtuple_error:;
6663 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
6664 0 : __pyx_L6_skip:;
6665 0 : goto __pyx_L4_argument_unpacking_done;
6666 0 : __pyx_L3_error:;
6667 : {
6668 0 : Py_ssize_t __pyx_temp;
6669 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6670 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
6671 : }
6672 : }
6673 0 : __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6674 0 : __Pyx_RefNannyFinishContext();
6675 0 : return NULL;
6676 0 : __pyx_L4_argument_unpacking_done:;
6677 0 : __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v___pyx_state);
6678 :
6679 : /* function exit code */
6680 : {
6681 0 : Py_ssize_t __pyx_temp;
6682 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6683 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
6684 : }
6685 : }
6686 : __Pyx_RefNannyFinishContext();
6687 : return __pyx_r;
6688 : }
6689 :
6690 0 : static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6691 0 : PyObject *__pyx_r = NULL;
6692 : __Pyx_RefNannyDeclarations
6693 0 : int __pyx_lineno = 0;
6694 0 : const char *__pyx_filename = NULL;
6695 0 : int __pyx_clineno = 0;
6696 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
6697 :
6698 : /* "(tree fragment)":4
6699 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6700 : * def __setstate_cython__(self, __pyx_state):
6701 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
6702 : */
6703 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
6704 0 : __PYX_ERR(1, 4, __pyx_L1_error)
6705 :
6706 : /* "(tree fragment)":3
6707 : * def __reduce_cython__(self):
6708 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6709 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6710 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6711 : */
6712 :
6713 : /* function exit code */
6714 0 : __pyx_L1_error:;
6715 0 : __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6716 0 : __pyx_r = NULL;
6717 0 : __Pyx_XGIVEREF(__pyx_r);
6718 0 : __Pyx_RefNannyFinishContext();
6719 0 : return __pyx_r;
6720 : }
6721 :
6722 : /* "View.MemoryView":248
6723 : *
6724 : * @cname("__pyx_array_allocate_buffer")
6725 : * cdef int _allocate_buffer(array self) except -1: # <<<<<<<<<<<<<<
6726 : *
6727 : *
6728 : */
6729 :
6730 0 : static int __pyx_array_allocate_buffer(struct __pyx_array_obj *__pyx_v_self) {
6731 0 : Py_ssize_t __pyx_v_i;
6732 0 : PyObject **__pyx_v_p;
6733 0 : int __pyx_r;
6734 0 : int __pyx_t_1;
6735 0 : Py_ssize_t __pyx_t_2;
6736 0 : Py_ssize_t __pyx_t_3;
6737 0 : Py_ssize_t __pyx_t_4;
6738 0 : int __pyx_lineno = 0;
6739 0 : const char *__pyx_filename = NULL;
6740 0 : int __pyx_clineno = 0;
6741 :
6742 : /* "View.MemoryView":254
6743 : * cdef PyObject **p
6744 : *
6745 : * self.free_data = True # <<<<<<<<<<<<<<
6746 : * self.data = <char *>malloc(self.len)
6747 : * if not self.data:
6748 : */
6749 0 : __pyx_v_self->free_data = 1;
6750 :
6751 : /* "View.MemoryView":255
6752 : *
6753 : * self.free_data = True
6754 : * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
6755 : * if not self.data:
6756 : * raise MemoryError, "unable to allocate array data."
6757 : */
6758 0 : __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
6759 :
6760 : /* "View.MemoryView":256
6761 : * self.free_data = True
6762 : * self.data = <char *>malloc(self.len)
6763 : * if not self.data: # <<<<<<<<<<<<<<
6764 : * raise MemoryError, "unable to allocate array data."
6765 : *
6766 : */
6767 0 : __pyx_t_1 = (!(__pyx_v_self->data != 0));
6768 0 : if (unlikely(__pyx_t_1)) {
6769 :
6770 : /* "View.MemoryView":257
6771 : * self.data = <char *>malloc(self.len)
6772 : * if not self.data:
6773 : * raise MemoryError, "unable to allocate array data." # <<<<<<<<<<<<<<
6774 : *
6775 : * if self.dtype_is_object:
6776 : */
6777 0 : __Pyx_Raise(__pyx_builtin_MemoryError, __pyx_kp_s_unable_to_allocate_array_data, 0, 0);
6778 0 : __PYX_ERR(1, 257, __pyx_L1_error)
6779 :
6780 : /* "View.MemoryView":256
6781 : * self.free_data = True
6782 : * self.data = <char *>malloc(self.len)
6783 : * if not self.data: # <<<<<<<<<<<<<<
6784 : * raise MemoryError, "unable to allocate array data."
6785 : *
6786 : */
6787 : }
6788 :
6789 : /* "View.MemoryView":259
6790 : * raise MemoryError, "unable to allocate array data."
6791 : *
6792 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
6793 : * p = <PyObject **> self.data
6794 : * for i in range(self.len // self.itemsize):
6795 : */
6796 0 : if (__pyx_v_self->dtype_is_object) {
6797 :
6798 : /* "View.MemoryView":260
6799 : *
6800 : * if self.dtype_is_object:
6801 : * p = <PyObject **> self.data # <<<<<<<<<<<<<<
6802 : * for i in range(self.len // self.itemsize):
6803 : * p[i] = Py_None
6804 : */
6805 0 : __pyx_v_p = ((PyObject **)__pyx_v_self->data);
6806 :
6807 : /* "View.MemoryView":261
6808 : * if self.dtype_is_object:
6809 : * p = <PyObject **> self.data
6810 : * for i in range(self.len // self.itemsize): # <<<<<<<<<<<<<<
6811 : * p[i] = Py_None
6812 : * Py_INCREF(Py_None)
6813 : */
6814 0 : if (unlikely(__pyx_v_self->itemsize == 0)) {
6815 0 : PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
6816 0 : __PYX_ERR(1, 261, __pyx_L1_error)
6817 : }
6818 0 : else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_self->itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
6819 0 : PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
6820 0 : __PYX_ERR(1, 261, __pyx_L1_error)
6821 : }
6822 0 : __pyx_t_2 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_self->itemsize);
6823 0 : __pyx_t_3 = __pyx_t_2;
6824 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
6825 0 : __pyx_v_i = __pyx_t_4;
6826 :
6827 : /* "View.MemoryView":262
6828 : * p = <PyObject **> self.data
6829 : * for i in range(self.len // self.itemsize):
6830 : * p[i] = Py_None # <<<<<<<<<<<<<<
6831 : * Py_INCREF(Py_None)
6832 : * return 0
6833 : */
6834 0 : (__pyx_v_p[__pyx_v_i]) = Py_None;
6835 :
6836 : /* "View.MemoryView":263
6837 : * for i in range(self.len // self.itemsize):
6838 : * p[i] = Py_None
6839 : * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
6840 : * return 0
6841 : *
6842 : */
6843 0 : Py_INCREF(Py_None);
6844 : }
6845 :
6846 : /* "View.MemoryView":259
6847 : * raise MemoryError, "unable to allocate array data."
6848 : *
6849 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
6850 : * p = <PyObject **> self.data
6851 : * for i in range(self.len // self.itemsize):
6852 : */
6853 : }
6854 :
6855 : /* "View.MemoryView":264
6856 : * p[i] = Py_None
6857 : * Py_INCREF(Py_None)
6858 : * return 0 # <<<<<<<<<<<<<<
6859 : *
6860 : *
6861 : */
6862 0 : __pyx_r = 0;
6863 0 : goto __pyx_L0;
6864 :
6865 : /* "View.MemoryView":248
6866 : *
6867 : * @cname("__pyx_array_allocate_buffer")
6868 : * cdef int _allocate_buffer(array self) except -1: # <<<<<<<<<<<<<<
6869 : *
6870 : *
6871 : */
6872 :
6873 : /* function exit code */
6874 0 : __pyx_L1_error:;
6875 0 : __Pyx_AddTraceback("View.MemoryView._allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
6876 0 : __pyx_r = -1;
6877 0 : __pyx_L0:;
6878 0 : return __pyx_r;
6879 : }
6880 :
6881 : /* "View.MemoryView":268
6882 : *
6883 : * @cname("__pyx_array_new")
6884 : * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf): # <<<<<<<<<<<<<<
6885 : * cdef array result
6886 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
6887 : */
6888 :
6889 0 : static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_c_mode, char *__pyx_v_buf) {
6890 0 : struct __pyx_array_obj *__pyx_v_result = 0;
6891 0 : PyObject *__pyx_v_mode = 0;
6892 0 : struct __pyx_array_obj *__pyx_r = NULL;
6893 : __Pyx_RefNannyDeclarations
6894 0 : PyObject *__pyx_t_1 = NULL;
6895 0 : int __pyx_t_2;
6896 0 : PyObject *__pyx_t_3 = NULL;
6897 0 : PyObject *__pyx_t_4 = NULL;
6898 0 : int __pyx_lineno = 0;
6899 0 : const char *__pyx_filename = NULL;
6900 0 : int __pyx_clineno = 0;
6901 0 : __Pyx_RefNannySetupContext("array_cwrapper", 1);
6902 :
6903 : /* "View.MemoryView":270
6904 : * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf):
6905 : * cdef array result
6906 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string. # <<<<<<<<<<<<<<
6907 : *
6908 : * if buf is NULL:
6909 : */
6910 0 : __pyx_t_2 = ((__pyx_v_c_mode[0]) == 'f');
6911 0 : if (__pyx_t_2) {
6912 0 : __Pyx_INCREF(__pyx_n_s_fortran);
6913 : __pyx_t_1 = __pyx_n_s_fortran;
6914 : } else {
6915 0 : __Pyx_INCREF(__pyx_n_s_c);
6916 : __pyx_t_1 = __pyx_n_s_c;
6917 : }
6918 0 : __pyx_v_mode = ((PyObject*)__pyx_t_1);
6919 0 : __pyx_t_1 = 0;
6920 :
6921 : /* "View.MemoryView":272
6922 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
6923 : *
6924 : * if buf is NULL: # <<<<<<<<<<<<<<
6925 : * result = array.__new__(array, shape, itemsize, format, mode)
6926 : * else:
6927 : */
6928 0 : __pyx_t_2 = (__pyx_v_buf == NULL);
6929 0 : if (__pyx_t_2) {
6930 :
6931 : /* "View.MemoryView":273
6932 : *
6933 : * if buf is NULL:
6934 : * result = array.__new__(array, shape, itemsize, format, mode) # <<<<<<<<<<<<<<
6935 : * else:
6936 : * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
6937 : */
6938 0 : __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 273, __pyx_L1_error)
6939 0 : __Pyx_GOTREF(__pyx_t_1);
6940 0 : __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error)
6941 0 : __Pyx_GOTREF(__pyx_t_3);
6942 0 : __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 273, __pyx_L1_error)
6943 0 : __Pyx_GOTREF(__pyx_t_4);
6944 0 : __Pyx_INCREF(__pyx_v_shape);
6945 0 : __Pyx_GIVEREF(__pyx_v_shape);
6946 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape)) __PYX_ERR(1, 273, __pyx_L1_error);
6947 0 : __Pyx_GIVEREF(__pyx_t_1);
6948 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 273, __pyx_L1_error);
6949 0 : __Pyx_GIVEREF(__pyx_t_3);
6950 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error);
6951 0 : __Pyx_INCREF(__pyx_v_mode);
6952 0 : __Pyx_GIVEREF(__pyx_v_mode);
6953 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_mode)) __PYX_ERR(1, 273, __pyx_L1_error);
6954 0 : __pyx_t_1 = 0;
6955 0 : __pyx_t_3 = 0;
6956 0 : __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_array_type), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error)
6957 0 : __Pyx_GOTREF((PyObject *)__pyx_t_3);
6958 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6959 0 : __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
6960 0 : __pyx_t_3 = 0;
6961 :
6962 : /* "View.MemoryView":272
6963 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
6964 : *
6965 : * if buf is NULL: # <<<<<<<<<<<<<<
6966 : * result = array.__new__(array, shape, itemsize, format, mode)
6967 : * else:
6968 : */
6969 0 : goto __pyx_L3;
6970 : }
6971 :
6972 : /* "View.MemoryView":275
6973 : * result = array.__new__(array, shape, itemsize, format, mode)
6974 : * else:
6975 : * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False) # <<<<<<<<<<<<<<
6976 : * result.data = buf
6977 : *
6978 : */
6979 : /*else*/ {
6980 0 : __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error)
6981 0 : __Pyx_GOTREF(__pyx_t_3);
6982 0 : __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error)
6983 0 : __Pyx_GOTREF(__pyx_t_4);
6984 0 : __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 275, __pyx_L1_error)
6985 0 : __Pyx_GOTREF(__pyx_t_1);
6986 0 : __Pyx_INCREF(__pyx_v_shape);
6987 0 : __Pyx_GIVEREF(__pyx_v_shape);
6988 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_shape)) __PYX_ERR(1, 275, __pyx_L1_error);
6989 0 : __Pyx_GIVEREF(__pyx_t_3);
6990 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error);
6991 0 : __Pyx_GIVEREF(__pyx_t_4);
6992 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error);
6993 0 : __Pyx_INCREF(__pyx_v_mode);
6994 0 : __Pyx_GIVEREF(__pyx_v_mode);
6995 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_mode)) __PYX_ERR(1, 275, __pyx_L1_error);
6996 0 : __pyx_t_3 = 0;
6997 0 : __pyx_t_4 = 0;
6998 0 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error)
6999 0 : __Pyx_GOTREF(__pyx_t_4);
7000 0 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 275, __pyx_L1_error)
7001 0 : __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_array_type), __pyx_t_1, __pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error)
7002 0 : __Pyx_GOTREF((PyObject *)__pyx_t_3);
7003 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7004 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7005 0 : __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
7006 0 : __pyx_t_3 = 0;
7007 :
7008 : /* "View.MemoryView":276
7009 : * else:
7010 : * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
7011 : * result.data = buf # <<<<<<<<<<<<<<
7012 : *
7013 : * return result
7014 : */
7015 0 : __pyx_v_result->data = __pyx_v_buf;
7016 : }
7017 0 : __pyx_L3:;
7018 :
7019 : /* "View.MemoryView":278
7020 : * result.data = buf
7021 : *
7022 : * return result # <<<<<<<<<<<<<<
7023 : *
7024 : *
7025 : */
7026 0 : __Pyx_XDECREF((PyObject *)__pyx_r);
7027 0 : __Pyx_INCREF((PyObject *)__pyx_v_result);
7028 0 : __pyx_r = __pyx_v_result;
7029 0 : goto __pyx_L0;
7030 :
7031 : /* "View.MemoryView":268
7032 : *
7033 : * @cname("__pyx_array_new")
7034 : * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf): # <<<<<<<<<<<<<<
7035 : * cdef array result
7036 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
7037 : */
7038 :
7039 : /* function exit code */
7040 0 : __pyx_L1_error:;
7041 0 : __Pyx_XDECREF(__pyx_t_1);
7042 0 : __Pyx_XDECREF(__pyx_t_3);
7043 0 : __Pyx_XDECREF(__pyx_t_4);
7044 0 : __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
7045 0 : __pyx_r = 0;
7046 0 : __pyx_L0:;
7047 0 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
7048 0 : __Pyx_XDECREF(__pyx_v_mode);
7049 0 : __Pyx_XGIVEREF((PyObject *)__pyx_r);
7050 0 : __Pyx_RefNannyFinishContext();
7051 0 : return __pyx_r;
7052 : }
7053 :
7054 : /* "View.MemoryView":304
7055 : * cdef class Enum(object):
7056 : * cdef object name
7057 : * def __init__(self, name): # <<<<<<<<<<<<<<
7058 : * self.name = name
7059 : * def __repr__(self):
7060 : */
7061 :
7062 : /* Python wrapper */
7063 : static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7064 15 : static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7065 15 : PyObject *__pyx_v_name = 0;
7066 15 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7067 15 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7068 15 : PyObject* values[1] = {0};
7069 15 : int __pyx_lineno = 0;
7070 15 : const char *__pyx_filename = NULL;
7071 15 : int __pyx_clineno = 0;
7072 15 : int __pyx_r;
7073 : __Pyx_RefNannyDeclarations
7074 15 : __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
7075 : #if CYTHON_ASSUME_SAFE_MACROS
7076 15 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7077 : #else
7078 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
7079 : #endif
7080 15 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7081 : {
7082 15 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
7083 15 : if (__pyx_kwds) {
7084 0 : Py_ssize_t kw_args;
7085 0 : switch (__pyx_nargs) {
7086 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
7087 0 : CYTHON_FALLTHROUGH;
7088 0 : case 0: break;
7089 0 : default: goto __pyx_L5_argtuple_error;
7090 : }
7091 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
7092 0 : switch (__pyx_nargs) {
7093 0 : case 0:
7094 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
7095 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
7096 0 : kw_args--;
7097 : }
7098 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 304, __pyx_L3_error)
7099 0 : else goto __pyx_L5_argtuple_error;
7100 : }
7101 0 : if (unlikely(kw_args > 0)) {
7102 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
7103 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 304, __pyx_L3_error)
7104 : }
7105 15 : } else if (unlikely(__pyx_nargs != 1)) {
7106 0 : goto __pyx_L5_argtuple_error;
7107 : } else {
7108 15 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
7109 : }
7110 15 : __pyx_v_name = values[0];
7111 : }
7112 15 : goto __pyx_L6_skip;
7113 0 : __pyx_L5_argtuple_error:;
7114 0 : __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 304, __pyx_L3_error)
7115 15 : __pyx_L6_skip:;
7116 15 : goto __pyx_L4_argument_unpacking_done;
7117 0 : __pyx_L3_error:;
7118 : {
7119 0 : Py_ssize_t __pyx_temp;
7120 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7121 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
7122 : }
7123 : }
7124 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7125 0 : __Pyx_RefNannyFinishContext();
7126 0 : return -1;
7127 15 : __pyx_L4_argument_unpacking_done:;
7128 15 : __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
7129 :
7130 : /* function exit code */
7131 : {
7132 15 : Py_ssize_t __pyx_temp;
7133 15 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7134 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
7135 : }
7136 : }
7137 : __Pyx_RefNannyFinishContext();
7138 : return __pyx_r;
7139 : }
7140 :
7141 15 : static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
7142 15 : int __pyx_r;
7143 : __Pyx_RefNannyDeclarations
7144 15 : __Pyx_RefNannySetupContext("__init__", 1);
7145 :
7146 : /* "View.MemoryView":305
7147 : * cdef object name
7148 : * def __init__(self, name):
7149 : * self.name = name # <<<<<<<<<<<<<<
7150 : * def __repr__(self):
7151 : * return self.name
7152 : */
7153 15 : __Pyx_INCREF(__pyx_v_name);
7154 15 : __Pyx_GIVEREF(__pyx_v_name);
7155 15 : __Pyx_GOTREF(__pyx_v_self->name);
7156 15 : __Pyx_DECREF(__pyx_v_self->name);
7157 15 : __pyx_v_self->name = __pyx_v_name;
7158 :
7159 : /* "View.MemoryView":304
7160 : * cdef class Enum(object):
7161 : * cdef object name
7162 : * def __init__(self, name): # <<<<<<<<<<<<<<
7163 : * self.name = name
7164 : * def __repr__(self):
7165 : */
7166 :
7167 : /* function exit code */
7168 15 : __pyx_r = 0;
7169 15 : __Pyx_RefNannyFinishContext();
7170 15 : return __pyx_r;
7171 : }
7172 :
7173 : /* "View.MemoryView":306
7174 : * def __init__(self, name):
7175 : * self.name = name
7176 : * def __repr__(self): # <<<<<<<<<<<<<<
7177 : * return self.name
7178 : *
7179 : */
7180 :
7181 : /* Python wrapper */
7182 : static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
7183 0 : static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
7184 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7185 0 : PyObject *__pyx_r = 0;
7186 : __Pyx_RefNannyDeclarations
7187 0 : __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
7188 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7189 0 : __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
7190 :
7191 : /* function exit code */
7192 0 : __Pyx_RefNannyFinishContext();
7193 0 : return __pyx_r;
7194 : }
7195 :
7196 0 : static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
7197 0 : PyObject *__pyx_r = NULL;
7198 : __Pyx_RefNannyDeclarations
7199 0 : __Pyx_RefNannySetupContext("__repr__", 1);
7200 :
7201 : /* "View.MemoryView":307
7202 : * self.name = name
7203 : * def __repr__(self):
7204 : * return self.name # <<<<<<<<<<<<<<
7205 : *
7206 : * cdef generic = Enum("<strided and direct or indirect>")
7207 : */
7208 0 : __Pyx_XDECREF(__pyx_r);
7209 0 : __Pyx_INCREF(__pyx_v_self->name);
7210 0 : __pyx_r = __pyx_v_self->name;
7211 0 : goto __pyx_L0;
7212 :
7213 : /* "View.MemoryView":306
7214 : * def __init__(self, name):
7215 : * self.name = name
7216 : * def __repr__(self): # <<<<<<<<<<<<<<
7217 : * return self.name
7218 : *
7219 : */
7220 :
7221 : /* function exit code */
7222 0 : __pyx_L0:;
7223 0 : __Pyx_XGIVEREF(__pyx_r);
7224 0 : __Pyx_RefNannyFinishContext();
7225 0 : return __pyx_r;
7226 : }
7227 :
7228 : /* "(tree fragment)":1
7229 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7230 : * cdef tuple state
7231 : * cdef object _dict
7232 : */
7233 :
7234 : /* Python wrapper */
7235 : static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
7236 : #if CYTHON_METH_FASTCALL
7237 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7238 : #else
7239 : PyObject *__pyx_args, PyObject *__pyx_kwds
7240 : #endif
7241 : ); /*proto*/
7242 0 : static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
7243 : #if CYTHON_METH_FASTCALL
7244 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7245 : #else
7246 : PyObject *__pyx_args, PyObject *__pyx_kwds
7247 : #endif
7248 : ) {
7249 : #if !CYTHON_METH_FASTCALL
7250 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7251 : #endif
7252 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7253 0 : PyObject *__pyx_r = 0;
7254 : __Pyx_RefNannyDeclarations
7255 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7256 : #if !CYTHON_METH_FASTCALL
7257 : #if CYTHON_ASSUME_SAFE_MACROS
7258 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7259 : #else
7260 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7261 : #endif
7262 : #endif
7263 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7264 0 : if (unlikely(__pyx_nargs > 0)) {
7265 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
7266 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
7267 0 : __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
7268 :
7269 : /* function exit code */
7270 0 : __Pyx_RefNannyFinishContext();
7271 0 : return __pyx_r;
7272 : }
7273 :
7274 0 : static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
7275 0 : PyObject *__pyx_v_state = 0;
7276 0 : PyObject *__pyx_v__dict = 0;
7277 0 : int __pyx_v_use_setstate;
7278 0 : PyObject *__pyx_r = NULL;
7279 : __Pyx_RefNannyDeclarations
7280 0 : PyObject *__pyx_t_1 = NULL;
7281 0 : int __pyx_t_2;
7282 0 : PyObject *__pyx_t_3 = NULL;
7283 0 : PyObject *__pyx_t_4 = NULL;
7284 0 : int __pyx_lineno = 0;
7285 0 : const char *__pyx_filename = NULL;
7286 0 : int __pyx_clineno = 0;
7287 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
7288 :
7289 : /* "(tree fragment)":5
7290 : * cdef object _dict
7291 : * cdef bint use_setstate
7292 : * state = (self.name,) # <<<<<<<<<<<<<<
7293 : * _dict = getattr(self, '__dict__', None)
7294 : * if _dict is not None:
7295 : */
7296 0 : __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
7297 0 : __Pyx_GOTREF(__pyx_t_1);
7298 0 : __Pyx_INCREF(__pyx_v_self->name);
7299 0 : __Pyx_GIVEREF(__pyx_v_self->name);
7300 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name)) __PYX_ERR(1, 5, __pyx_L1_error);
7301 0 : __pyx_v_state = ((PyObject*)__pyx_t_1);
7302 0 : __pyx_t_1 = 0;
7303 :
7304 : /* "(tree fragment)":6
7305 : * cdef bint use_setstate
7306 : * state = (self.name,)
7307 : * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
7308 : * if _dict is not None:
7309 : * state += (_dict,)
7310 : */
7311 0 : __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
7312 0 : __Pyx_GOTREF(__pyx_t_1);
7313 0 : __pyx_v__dict = __pyx_t_1;
7314 0 : __pyx_t_1 = 0;
7315 :
7316 : /* "(tree fragment)":7
7317 : * state = (self.name,)
7318 : * _dict = getattr(self, '__dict__', None)
7319 : * if _dict is not None: # <<<<<<<<<<<<<<
7320 : * state += (_dict,)
7321 : * use_setstate = True
7322 : */
7323 0 : __pyx_t_2 = (__pyx_v__dict != Py_None);
7324 0 : if (__pyx_t_2) {
7325 :
7326 : /* "(tree fragment)":8
7327 : * _dict = getattr(self, '__dict__', None)
7328 : * if _dict is not None:
7329 : * state += (_dict,) # <<<<<<<<<<<<<<
7330 : * use_setstate = True
7331 : * else:
7332 : */
7333 0 : __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
7334 0 : __Pyx_GOTREF(__pyx_t_1);
7335 0 : __Pyx_INCREF(__pyx_v__dict);
7336 0 : __Pyx_GIVEREF(__pyx_v__dict);
7337 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(1, 8, __pyx_L1_error);
7338 0 : __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
7339 0 : __Pyx_GOTREF(__pyx_t_3);
7340 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7341 0 : __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
7342 0 : __pyx_t_3 = 0;
7343 :
7344 : /* "(tree fragment)":9
7345 : * if _dict is not None:
7346 : * state += (_dict,)
7347 : * use_setstate = True # <<<<<<<<<<<<<<
7348 : * else:
7349 : * use_setstate = self.name is not None
7350 : */
7351 0 : __pyx_v_use_setstate = 1;
7352 :
7353 : /* "(tree fragment)":7
7354 : * state = (self.name,)
7355 : * _dict = getattr(self, '__dict__', None)
7356 : * if _dict is not None: # <<<<<<<<<<<<<<
7357 : * state += (_dict,)
7358 : * use_setstate = True
7359 : */
7360 0 : goto __pyx_L3;
7361 : }
7362 :
7363 : /* "(tree fragment)":11
7364 : * use_setstate = True
7365 : * else:
7366 : * use_setstate = self.name is not None # <<<<<<<<<<<<<<
7367 : * if use_setstate:
7368 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7369 : */
7370 : /*else*/ {
7371 0 : __pyx_t_2 = (__pyx_v_self->name != Py_None);
7372 0 : __pyx_v_use_setstate = __pyx_t_2;
7373 : }
7374 0 : __pyx_L3:;
7375 :
7376 : /* "(tree fragment)":12
7377 : * else:
7378 : * use_setstate = self.name is not None
7379 : * if use_setstate: # <<<<<<<<<<<<<<
7380 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7381 : * else:
7382 : */
7383 0 : if (__pyx_v_use_setstate) {
7384 :
7385 : /* "(tree fragment)":13
7386 : * use_setstate = self.name is not None
7387 : * if use_setstate:
7388 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state # <<<<<<<<<<<<<<
7389 : * else:
7390 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7391 : */
7392 0 : __Pyx_XDECREF(__pyx_r);
7393 0 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
7394 0 : __Pyx_GOTREF(__pyx_t_3);
7395 0 : __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
7396 0 : __Pyx_GOTREF(__pyx_t_1);
7397 0 : __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7398 0 : __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7399 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 13, __pyx_L1_error);
7400 0 : __Pyx_INCREF(__pyx_int_136983863);
7401 0 : __Pyx_GIVEREF(__pyx_int_136983863);
7402 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_136983863)) __PYX_ERR(1, 13, __pyx_L1_error);
7403 0 : __Pyx_INCREF(Py_None);
7404 0 : __Pyx_GIVEREF(Py_None);
7405 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(1, 13, __pyx_L1_error);
7406 0 : __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
7407 0 : __Pyx_GOTREF(__pyx_t_4);
7408 0 : __Pyx_GIVEREF(__pyx_t_3);
7409 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error);
7410 0 : __Pyx_GIVEREF(__pyx_t_1);
7411 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error);
7412 0 : __Pyx_INCREF(__pyx_v_state);
7413 0 : __Pyx_GIVEREF(__pyx_v_state);
7414 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(1, 13, __pyx_L1_error);
7415 0 : __pyx_t_3 = 0;
7416 0 : __pyx_t_1 = 0;
7417 0 : __pyx_r = __pyx_t_4;
7418 0 : __pyx_t_4 = 0;
7419 0 : goto __pyx_L0;
7420 :
7421 : /* "(tree fragment)":12
7422 : * else:
7423 : * use_setstate = self.name is not None
7424 : * if use_setstate: # <<<<<<<<<<<<<<
7425 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7426 : * else:
7427 : */
7428 : }
7429 :
7430 : /* "(tree fragment)":15
7431 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7432 : * else:
7433 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state) # <<<<<<<<<<<<<<
7434 : * def __setstate_cython__(self, __pyx_state):
7435 : * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7436 : */
7437 : /*else*/ {
7438 0 : __Pyx_XDECREF(__pyx_r);
7439 0 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
7440 0 : __Pyx_GOTREF(__pyx_t_4);
7441 0 : __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
7442 0 : __Pyx_GOTREF(__pyx_t_1);
7443 0 : __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7444 0 : __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7445 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 15, __pyx_L1_error);
7446 0 : __Pyx_INCREF(__pyx_int_136983863);
7447 0 : __Pyx_GIVEREF(__pyx_int_136983863);
7448 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_136983863)) __PYX_ERR(1, 15, __pyx_L1_error);
7449 0 : __Pyx_INCREF(__pyx_v_state);
7450 0 : __Pyx_GIVEREF(__pyx_v_state);
7451 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(1, 15, __pyx_L1_error);
7452 0 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
7453 0 : __Pyx_GOTREF(__pyx_t_3);
7454 0 : __Pyx_GIVEREF(__pyx_t_4);
7455 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error);
7456 0 : __Pyx_GIVEREF(__pyx_t_1);
7457 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error);
7458 0 : __pyx_t_4 = 0;
7459 0 : __pyx_t_1 = 0;
7460 0 : __pyx_r = __pyx_t_3;
7461 0 : __pyx_t_3 = 0;
7462 0 : goto __pyx_L0;
7463 : }
7464 :
7465 : /* "(tree fragment)":1
7466 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7467 : * cdef tuple state
7468 : * cdef object _dict
7469 : */
7470 :
7471 : /* function exit code */
7472 0 : __pyx_L1_error:;
7473 0 : __Pyx_XDECREF(__pyx_t_1);
7474 0 : __Pyx_XDECREF(__pyx_t_3);
7475 0 : __Pyx_XDECREF(__pyx_t_4);
7476 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7477 0 : __pyx_r = NULL;
7478 0 : __pyx_L0:;
7479 0 : __Pyx_XDECREF(__pyx_v_state);
7480 0 : __Pyx_XDECREF(__pyx_v__dict);
7481 0 : __Pyx_XGIVEREF(__pyx_r);
7482 0 : __Pyx_RefNannyFinishContext();
7483 0 : return __pyx_r;
7484 : }
7485 :
7486 : /* "(tree fragment)":16
7487 : * else:
7488 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7489 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7490 : * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7491 : */
7492 :
7493 : /* Python wrapper */
7494 : static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
7495 : #if CYTHON_METH_FASTCALL
7496 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7497 : #else
7498 : PyObject *__pyx_args, PyObject *__pyx_kwds
7499 : #endif
7500 : ); /*proto*/
7501 0 : static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
7502 : #if CYTHON_METH_FASTCALL
7503 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7504 : #else
7505 : PyObject *__pyx_args, PyObject *__pyx_kwds
7506 : #endif
7507 : ) {
7508 0 : PyObject *__pyx_v___pyx_state = 0;
7509 : #if !CYTHON_METH_FASTCALL
7510 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7511 : #endif
7512 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7513 0 : PyObject* values[1] = {0};
7514 0 : int __pyx_lineno = 0;
7515 0 : const char *__pyx_filename = NULL;
7516 0 : int __pyx_clineno = 0;
7517 0 : PyObject *__pyx_r = 0;
7518 : __Pyx_RefNannyDeclarations
7519 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7520 : #if !CYTHON_METH_FASTCALL
7521 : #if CYTHON_ASSUME_SAFE_MACROS
7522 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7523 : #else
7524 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7525 : #endif
7526 : #endif
7527 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7528 : {
7529 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
7530 0 : if (__pyx_kwds) {
7531 0 : Py_ssize_t kw_args;
7532 0 : switch (__pyx_nargs) {
7533 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
7534 0 : CYTHON_FALLTHROUGH;
7535 0 : case 0: break;
7536 0 : default: goto __pyx_L5_argtuple_error;
7537 : }
7538 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
7539 0 : switch (__pyx_nargs) {
7540 : case 0:
7541 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
7542 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
7543 0 : kw_args--;
7544 : }
7545 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error)
7546 0 : else goto __pyx_L5_argtuple_error;
7547 : }
7548 0 : if (unlikely(kw_args > 0)) {
7549 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
7550 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error)
7551 : }
7552 0 : } else if (unlikely(__pyx_nargs != 1)) {
7553 0 : goto __pyx_L5_argtuple_error;
7554 : } else {
7555 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
7556 : }
7557 0 : __pyx_v___pyx_state = values[0];
7558 : }
7559 0 : goto __pyx_L6_skip;
7560 0 : __pyx_L5_argtuple_error:;
7561 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error)
7562 0 : __pyx_L6_skip:;
7563 0 : goto __pyx_L4_argument_unpacking_done;
7564 0 : __pyx_L3_error:;
7565 : {
7566 0 : Py_ssize_t __pyx_temp;
7567 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7568 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
7569 : }
7570 : }
7571 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7572 0 : __Pyx_RefNannyFinishContext();
7573 0 : return NULL;
7574 0 : __pyx_L4_argument_unpacking_done:;
7575 0 : __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v___pyx_state);
7576 :
7577 : /* function exit code */
7578 : {
7579 0 : Py_ssize_t __pyx_temp;
7580 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7581 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
7582 : }
7583 : }
7584 : __Pyx_RefNannyFinishContext();
7585 : return __pyx_r;
7586 : }
7587 :
7588 0 : static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7589 0 : PyObject *__pyx_r = NULL;
7590 : __Pyx_RefNannyDeclarations
7591 0 : PyObject *__pyx_t_1 = NULL;
7592 0 : int __pyx_lineno = 0;
7593 0 : const char *__pyx_filename = NULL;
7594 0 : int __pyx_clineno = 0;
7595 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
7596 :
7597 : /* "(tree fragment)":17
7598 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7599 : * def __setstate_cython__(self, __pyx_state):
7600 : * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
7601 : */
7602 0 : if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error)
7603 0 : __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
7604 0 : __Pyx_GOTREF(__pyx_t_1);
7605 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7606 :
7607 : /* "(tree fragment)":16
7608 : * else:
7609 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7610 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7611 : * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7612 : */
7613 :
7614 : /* function exit code */
7615 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7616 0 : goto __pyx_L0;
7617 0 : __pyx_L1_error:;
7618 0 : __Pyx_XDECREF(__pyx_t_1);
7619 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7620 0 : __pyx_r = NULL;
7621 0 : __pyx_L0:;
7622 0 : __Pyx_XGIVEREF(__pyx_r);
7623 0 : __Pyx_RefNannyFinishContext();
7624 0 : return __pyx_r;
7625 : }
7626 :
7627 : /* "View.MemoryView":349
7628 : * cdef __Pyx_TypeInfo *typeinfo
7629 : *
7630 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
7631 : * self.obj = obj
7632 : * self.flags = flags
7633 : */
7634 :
7635 : /* Python wrapper */
7636 : static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7637 0 : static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7638 0 : PyObject *__pyx_v_obj = 0;
7639 0 : int __pyx_v_flags;
7640 0 : int __pyx_v_dtype_is_object;
7641 0 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7642 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7643 0 : PyObject* values[3] = {0,0,0};
7644 0 : int __pyx_lineno = 0;
7645 0 : const char *__pyx_filename = NULL;
7646 0 : int __pyx_clineno = 0;
7647 0 : int __pyx_r;
7648 : __Pyx_RefNannyDeclarations
7649 0 : __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
7650 : #if CYTHON_ASSUME_SAFE_MACROS
7651 0 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7652 : #else
7653 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
7654 : #endif
7655 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7656 : {
7657 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
7658 0 : if (__pyx_kwds) {
7659 0 : Py_ssize_t kw_args;
7660 0 : switch (__pyx_nargs) {
7661 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
7662 0 : CYTHON_FALLTHROUGH;
7663 0 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
7664 0 : CYTHON_FALLTHROUGH;
7665 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
7666 0 : CYTHON_FALLTHROUGH;
7667 0 : case 0: break;
7668 0 : default: goto __pyx_L5_argtuple_error;
7669 : }
7670 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
7671 0 : switch (__pyx_nargs) {
7672 0 : case 0:
7673 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_obj)) != 0)) {
7674 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
7675 0 : kw_args--;
7676 : }
7677 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
7678 0 : else goto __pyx_L5_argtuple_error;
7679 0 : CYTHON_FALLTHROUGH;
7680 : case 1:
7681 0 : if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags)) != 0)) {
7682 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
7683 0 : kw_args--;
7684 : }
7685 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
7686 : else {
7687 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 349, __pyx_L3_error)
7688 : }
7689 0 : CYTHON_FALLTHROUGH;
7690 : case 2:
7691 0 : if (kw_args > 0) {
7692 0 : PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dtype_is_object);
7693 0 : if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
7694 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
7695 : }
7696 : }
7697 0 : if (unlikely(kw_args > 0)) {
7698 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
7699 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(1, 349, __pyx_L3_error)
7700 : }
7701 : } else {
7702 0 : switch (__pyx_nargs) {
7703 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
7704 0 : CYTHON_FALLTHROUGH;
7705 0 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
7706 0 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
7707 0 : break;
7708 0 : default: goto __pyx_L5_argtuple_error;
7709 : }
7710 : }
7711 0 : __pyx_v_obj = values[0];
7712 0 : __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
7713 0 : if (values[2]) {
7714 0 : __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
7715 : } else {
7716 : __pyx_v_dtype_is_object = ((int)0);
7717 : }
7718 : }
7719 0 : goto __pyx_L6_skip;
7720 0 : __pyx_L5_argtuple_error:;
7721 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 349, __pyx_L3_error)
7722 0 : __pyx_L6_skip:;
7723 0 : goto __pyx_L4_argument_unpacking_done;
7724 0 : __pyx_L3_error:;
7725 : {
7726 0 : Py_ssize_t __pyx_temp;
7727 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7728 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
7729 : }
7730 : }
7731 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7732 0 : __Pyx_RefNannyFinishContext();
7733 0 : return -1;
7734 0 : __pyx_L4_argument_unpacking_done:;
7735 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
7736 :
7737 : /* function exit code */
7738 : {
7739 0 : Py_ssize_t __pyx_temp;
7740 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7741 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
7742 : }
7743 : }
7744 : __Pyx_RefNannyFinishContext();
7745 : return __pyx_r;
7746 : }
7747 :
7748 0 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
7749 0 : int __pyx_r;
7750 : __Pyx_RefNannyDeclarations
7751 0 : int __pyx_t_1;
7752 0 : int __pyx_t_2;
7753 0 : int __pyx_t_3;
7754 0 : Py_intptr_t __pyx_t_4;
7755 0 : size_t __pyx_t_5;
7756 0 : int __pyx_lineno = 0;
7757 0 : const char *__pyx_filename = NULL;
7758 0 : int __pyx_clineno = 0;
7759 0 : __Pyx_RefNannySetupContext("__cinit__", 1);
7760 :
7761 : /* "View.MemoryView":350
7762 : *
7763 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
7764 : * self.obj = obj # <<<<<<<<<<<<<<
7765 : * self.flags = flags
7766 : * if type(self) is memoryview or obj is not None:
7767 : */
7768 0 : __Pyx_INCREF(__pyx_v_obj);
7769 0 : __Pyx_GIVEREF(__pyx_v_obj);
7770 0 : __Pyx_GOTREF(__pyx_v_self->obj);
7771 0 : __Pyx_DECREF(__pyx_v_self->obj);
7772 0 : __pyx_v_self->obj = __pyx_v_obj;
7773 :
7774 : /* "View.MemoryView":351
7775 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
7776 : * self.obj = obj
7777 : * self.flags = flags # <<<<<<<<<<<<<<
7778 : * if type(self) is memoryview or obj is not None:
7779 : * __Pyx_GetBuffer(obj, &self.view, flags)
7780 : */
7781 0 : __pyx_v_self->flags = __pyx_v_flags;
7782 :
7783 : /* "View.MemoryView":352
7784 : * self.obj = obj
7785 : * self.flags = flags
7786 : * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
7787 : * __Pyx_GetBuffer(obj, &self.view, flags)
7788 : * if <PyObject *> self.view.obj == NULL:
7789 : */
7790 0 : __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
7791 0 : if (!__pyx_t_2) {
7792 0 : } else {
7793 0 : __pyx_t_1 = __pyx_t_2;
7794 0 : goto __pyx_L4_bool_binop_done;
7795 : }
7796 0 : __pyx_t_2 = (__pyx_v_obj != Py_None);
7797 0 : __pyx_t_1 = __pyx_t_2;
7798 0 : __pyx_L4_bool_binop_done:;
7799 0 : if (__pyx_t_1) {
7800 :
7801 : /* "View.MemoryView":353
7802 : * self.flags = flags
7803 : * if type(self) is memoryview or obj is not None:
7804 : * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
7805 : * if <PyObject *> self.view.obj == NULL:
7806 : * (<__pyx_buffer *> &self.view).obj = Py_None
7807 : */
7808 0 : __pyx_t_3 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 353, __pyx_L1_error)
7809 :
7810 : /* "View.MemoryView":354
7811 : * if type(self) is memoryview or obj is not None:
7812 : * __Pyx_GetBuffer(obj, &self.view, flags)
7813 : * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
7814 : * (<__pyx_buffer *> &self.view).obj = Py_None
7815 : * Py_INCREF(Py_None)
7816 : */
7817 0 : __pyx_t_1 = (((PyObject *)__pyx_v_self->view.obj) == NULL);
7818 0 : if (__pyx_t_1) {
7819 :
7820 : /* "View.MemoryView":355
7821 : * __Pyx_GetBuffer(obj, &self.view, flags)
7822 : * if <PyObject *> self.view.obj == NULL:
7823 : * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
7824 : * Py_INCREF(Py_None)
7825 : *
7826 : */
7827 0 : ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
7828 :
7829 : /* "View.MemoryView":356
7830 : * if <PyObject *> self.view.obj == NULL:
7831 : * (<__pyx_buffer *> &self.view).obj = Py_None
7832 : * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
7833 : *
7834 : * if not __PYX_CYTHON_ATOMICS_ENABLED():
7835 : */
7836 0 : Py_INCREF(Py_None);
7837 :
7838 : /* "View.MemoryView":354
7839 : * if type(self) is memoryview or obj is not None:
7840 : * __Pyx_GetBuffer(obj, &self.view, flags)
7841 : * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
7842 : * (<__pyx_buffer *> &self.view).obj = Py_None
7843 : * Py_INCREF(Py_None)
7844 : */
7845 : }
7846 :
7847 : /* "View.MemoryView":352
7848 : * self.obj = obj
7849 : * self.flags = flags
7850 : * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
7851 : * __Pyx_GetBuffer(obj, &self.view, flags)
7852 : * if <PyObject *> self.view.obj == NULL:
7853 : */
7854 : }
7855 :
7856 : /* "View.MemoryView":358
7857 : * Py_INCREF(Py_None)
7858 : *
7859 : * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
7860 : * global __pyx_memoryview_thread_locks_used
7861 : * if __pyx_memoryview_thread_locks_used < 8:
7862 : */
7863 0 : __pyx_t_1 = (!__PYX_CYTHON_ATOMICS_ENABLED());
7864 0 : if (__pyx_t_1) {
7865 :
7866 : /* "View.MemoryView":360
7867 : * if not __PYX_CYTHON_ATOMICS_ENABLED():
7868 : * global __pyx_memoryview_thread_locks_used
7869 : * if __pyx_memoryview_thread_locks_used < 8: # <<<<<<<<<<<<<<
7870 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7871 : * __pyx_memoryview_thread_locks_used += 1
7872 : */
7873 : __pyx_t_1 = (__pyx_memoryview_thread_locks_used < 8);
7874 : if (__pyx_t_1) {
7875 :
7876 : /* "View.MemoryView":361
7877 : * global __pyx_memoryview_thread_locks_used
7878 : * if __pyx_memoryview_thread_locks_used < 8:
7879 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
7880 : * __pyx_memoryview_thread_locks_used += 1
7881 : * if self.lock is NULL:
7882 : */
7883 : __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
7884 :
7885 : /* "View.MemoryView":362
7886 : * if __pyx_memoryview_thread_locks_used < 8:
7887 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7888 : * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
7889 : * if self.lock is NULL:
7890 : * self.lock = PyThread_allocate_lock()
7891 : */
7892 : __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
7893 :
7894 : /* "View.MemoryView":360
7895 : * if not __PYX_CYTHON_ATOMICS_ENABLED():
7896 : * global __pyx_memoryview_thread_locks_used
7897 : * if __pyx_memoryview_thread_locks_used < 8: # <<<<<<<<<<<<<<
7898 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7899 : * __pyx_memoryview_thread_locks_used += 1
7900 : */
7901 : }
7902 :
7903 : /* "View.MemoryView":363
7904 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7905 : * __pyx_memoryview_thread_locks_used += 1
7906 : * if self.lock is NULL: # <<<<<<<<<<<<<<
7907 : * self.lock = PyThread_allocate_lock()
7908 : * if self.lock is NULL:
7909 : */
7910 : __pyx_t_1 = (__pyx_v_self->lock == NULL);
7911 : if (__pyx_t_1) {
7912 :
7913 : /* "View.MemoryView":364
7914 : * __pyx_memoryview_thread_locks_used += 1
7915 : * if self.lock is NULL:
7916 : * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
7917 : * if self.lock is NULL:
7918 : * raise MemoryError
7919 : */
7920 : __pyx_v_self->lock = PyThread_allocate_lock();
7921 :
7922 : /* "View.MemoryView":365
7923 : * if self.lock is NULL:
7924 : * self.lock = PyThread_allocate_lock()
7925 : * if self.lock is NULL: # <<<<<<<<<<<<<<
7926 : * raise MemoryError
7927 : *
7928 : */
7929 : __pyx_t_1 = (__pyx_v_self->lock == NULL);
7930 : if (unlikely(__pyx_t_1)) {
7931 :
7932 : /* "View.MemoryView":366
7933 : * self.lock = PyThread_allocate_lock()
7934 : * if self.lock is NULL:
7935 : * raise MemoryError # <<<<<<<<<<<<<<
7936 : *
7937 : * if flags & PyBUF_FORMAT:
7938 : */
7939 : PyErr_NoMemory(); __PYX_ERR(1, 366, __pyx_L1_error)
7940 :
7941 : /* "View.MemoryView":365
7942 : * if self.lock is NULL:
7943 : * self.lock = PyThread_allocate_lock()
7944 : * if self.lock is NULL: # <<<<<<<<<<<<<<
7945 : * raise MemoryError
7946 : *
7947 : */
7948 : }
7949 :
7950 : /* "View.MemoryView":363
7951 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7952 : * __pyx_memoryview_thread_locks_used += 1
7953 : * if self.lock is NULL: # <<<<<<<<<<<<<<
7954 : * self.lock = PyThread_allocate_lock()
7955 : * if self.lock is NULL:
7956 : */
7957 : }
7958 :
7959 : /* "View.MemoryView":358
7960 : * Py_INCREF(Py_None)
7961 : *
7962 : * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
7963 : * global __pyx_memoryview_thread_locks_used
7964 : * if __pyx_memoryview_thread_locks_used < 8:
7965 : */
7966 : }
7967 :
7968 : /* "View.MemoryView":368
7969 : * raise MemoryError
7970 : *
7971 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
7972 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
7973 : * else:
7974 : */
7975 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
7976 0 : if (__pyx_t_1) {
7977 :
7978 : /* "View.MemoryView":369
7979 : *
7980 : * if flags & PyBUF_FORMAT:
7981 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
7982 : * else:
7983 : * self.dtype_is_object = dtype_is_object
7984 : */
7985 0 : __pyx_t_2 = ((__pyx_v_self->view.format[0]) == 'O');
7986 0 : if (__pyx_t_2) {
7987 0 : } else {
7988 0 : __pyx_t_1 = __pyx_t_2;
7989 0 : goto __pyx_L12_bool_binop_done;
7990 : }
7991 0 : __pyx_t_2 = ((__pyx_v_self->view.format[1]) == '\x00');
7992 0 : __pyx_t_1 = __pyx_t_2;
7993 0 : __pyx_L12_bool_binop_done:;
7994 0 : __pyx_v_self->dtype_is_object = __pyx_t_1;
7995 :
7996 : /* "View.MemoryView":368
7997 : * raise MemoryError
7998 : *
7999 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8000 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8001 : * else:
8002 : */
8003 0 : goto __pyx_L11;
8004 : }
8005 :
8006 : /* "View.MemoryView":371
8007 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8008 : * else:
8009 : * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
8010 : *
8011 : * assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
8012 : */
8013 : /*else*/ {
8014 0 : __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
8015 : }
8016 0 : __pyx_L11:;
8017 :
8018 : /* "View.MemoryView":373
8019 : * self.dtype_is_object = dtype_is_object
8020 : *
8021 : * assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0 # <<<<<<<<<<<<<<
8022 : * self.typeinfo = NULL
8023 : *
8024 : */
8025 : #ifndef CYTHON_WITHOUT_ASSERTIONS
8026 0 : if (unlikely(__pyx_assertions_enabled())) {
8027 0 : __pyx_t_4 = ((Py_intptr_t)((void *)(&__pyx_v_self->acquisition_count)));
8028 0 : __pyx_t_5 = (sizeof(__pyx_atomic_int_type));
8029 0 : if (unlikely(__pyx_t_5 == 0)) {
8030 : PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
8031 : __PYX_ERR(1, 373, __pyx_L1_error)
8032 : }
8033 0 : __pyx_t_1 = ((__pyx_t_4 % __pyx_t_5) == 0);
8034 0 : if (unlikely(!__pyx_t_1)) {
8035 0 : __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
8036 0 : __PYX_ERR(1, 373, __pyx_L1_error)
8037 : }
8038 : }
8039 : #else
8040 : if ((1)); else __PYX_ERR(1, 373, __pyx_L1_error)
8041 : #endif
8042 :
8043 : /* "View.MemoryView":374
8044 : *
8045 : * assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
8046 : * self.typeinfo = NULL # <<<<<<<<<<<<<<
8047 : *
8048 : * def __dealloc__(memoryview self):
8049 : */
8050 0 : __pyx_v_self->typeinfo = NULL;
8051 :
8052 : /* "View.MemoryView":349
8053 : * cdef __Pyx_TypeInfo *typeinfo
8054 : *
8055 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
8056 : * self.obj = obj
8057 : * self.flags = flags
8058 : */
8059 :
8060 : /* function exit code */
8061 0 : __pyx_r = 0;
8062 0 : goto __pyx_L0;
8063 0 : __pyx_L1_error:;
8064 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8065 0 : __pyx_r = -1;
8066 0 : __pyx_L0:;
8067 0 : __Pyx_RefNannyFinishContext();
8068 0 : return __pyx_r;
8069 : }
8070 :
8071 : /* "View.MemoryView":376
8072 : * self.typeinfo = NULL
8073 : *
8074 : * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
8075 : * if self.obj is not None:
8076 : * __Pyx_ReleaseBuffer(&self.view)
8077 : */
8078 :
8079 : /* Python wrapper */
8080 : static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
8081 0 : static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
8082 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8083 : __Pyx_RefNannyDeclarations
8084 0 : __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
8085 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8086 0 : __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
8087 :
8088 : /* function exit code */
8089 0 : __Pyx_RefNannyFinishContext();
8090 : }
8091 :
8092 0 : static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
8093 0 : int __pyx_v_i;
8094 0 : int __pyx_t_1;
8095 0 : int __pyx_t_2;
8096 0 : int __pyx_t_3;
8097 0 : int __pyx_t_4;
8098 0 : PyThread_type_lock __pyx_t_5;
8099 0 : PyThread_type_lock __pyx_t_6;
8100 :
8101 : /* "View.MemoryView":377
8102 : *
8103 : * def __dealloc__(memoryview self):
8104 : * if self.obj is not None: # <<<<<<<<<<<<<<
8105 : * __Pyx_ReleaseBuffer(&self.view)
8106 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8107 : */
8108 0 : __pyx_t_1 = (__pyx_v_self->obj != Py_None);
8109 0 : if (__pyx_t_1) {
8110 :
8111 : /* "View.MemoryView":378
8112 : * def __dealloc__(memoryview self):
8113 : * if self.obj is not None:
8114 : * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
8115 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8116 : *
8117 : */
8118 0 : __Pyx_ReleaseBuffer((&__pyx_v_self->view));
8119 :
8120 : /* "View.MemoryView":377
8121 : *
8122 : * def __dealloc__(memoryview self):
8123 : * if self.obj is not None: # <<<<<<<<<<<<<<
8124 : * __Pyx_ReleaseBuffer(&self.view)
8125 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8126 : */
8127 0 : goto __pyx_L3;
8128 : }
8129 :
8130 : /* "View.MemoryView":379
8131 : * if self.obj is not None:
8132 : * __Pyx_ReleaseBuffer(&self.view)
8133 : * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
8134 : *
8135 : * (<__pyx_buffer *> &self.view).obj = NULL
8136 : */
8137 0 : __pyx_t_1 = (((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None);
8138 0 : if (__pyx_t_1) {
8139 :
8140 : /* "View.MemoryView":381
8141 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8142 : *
8143 : * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
8144 : * Py_DECREF(Py_None)
8145 : *
8146 : */
8147 0 : ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
8148 :
8149 : /* "View.MemoryView":382
8150 : *
8151 : * (<__pyx_buffer *> &self.view).obj = NULL
8152 : * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
8153 : *
8154 : * cdef int i
8155 : */
8156 0 : Py_DECREF(Py_None);
8157 :
8158 : /* "View.MemoryView":379
8159 : * if self.obj is not None:
8160 : * __Pyx_ReleaseBuffer(&self.view)
8161 : * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
8162 : *
8163 : * (<__pyx_buffer *> &self.view).obj = NULL
8164 : */
8165 : }
8166 0 : __pyx_L3:;
8167 :
8168 : /* "View.MemoryView":386
8169 : * cdef int i
8170 : * global __pyx_memoryview_thread_locks_used
8171 : * if self.lock != NULL: # <<<<<<<<<<<<<<
8172 : * for i in range(__pyx_memoryview_thread_locks_used):
8173 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8174 : */
8175 0 : __pyx_t_1 = (__pyx_v_self->lock != NULL);
8176 0 : if (__pyx_t_1) {
8177 :
8178 : /* "View.MemoryView":387
8179 : * global __pyx_memoryview_thread_locks_used
8180 : * if self.lock != NULL:
8181 : * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
8182 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8183 : * __pyx_memoryview_thread_locks_used -= 1
8184 : */
8185 0 : __pyx_t_2 = __pyx_memoryview_thread_locks_used;
8186 0 : __pyx_t_3 = __pyx_t_2;
8187 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
8188 0 : __pyx_v_i = __pyx_t_4;
8189 :
8190 : /* "View.MemoryView":388
8191 : * if self.lock != NULL:
8192 : * for i in range(__pyx_memoryview_thread_locks_used):
8193 : * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
8194 : * __pyx_memoryview_thread_locks_used -= 1
8195 : * if i != __pyx_memoryview_thread_locks_used:
8196 : */
8197 0 : __pyx_t_1 = ((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock);
8198 0 : if (__pyx_t_1) {
8199 :
8200 : /* "View.MemoryView":389
8201 : * for i in range(__pyx_memoryview_thread_locks_used):
8202 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8203 : * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
8204 : * if i != __pyx_memoryview_thread_locks_used:
8205 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8206 : */
8207 0 : __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
8208 :
8209 : /* "View.MemoryView":390
8210 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8211 : * __pyx_memoryview_thread_locks_used -= 1
8212 : * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
8213 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8214 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8215 : */
8216 0 : __pyx_t_1 = (__pyx_v_i != __pyx_memoryview_thread_locks_used);
8217 0 : if (__pyx_t_1) {
8218 :
8219 : /* "View.MemoryView":392
8220 : * if i != __pyx_memoryview_thread_locks_used:
8221 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8222 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
8223 : * break
8224 : * else:
8225 : */
8226 0 : __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
8227 0 : __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
8228 :
8229 : /* "View.MemoryView":391
8230 : * __pyx_memoryview_thread_locks_used -= 1
8231 : * if i != __pyx_memoryview_thread_locks_used:
8232 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
8233 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8234 : * break
8235 : */
8236 0 : (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
8237 0 : (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
8238 :
8239 : /* "View.MemoryView":390
8240 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8241 : * __pyx_memoryview_thread_locks_used -= 1
8242 : * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
8243 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8244 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8245 : */
8246 : }
8247 :
8248 : /* "View.MemoryView":393
8249 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8250 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8251 : * break # <<<<<<<<<<<<<<
8252 : * else:
8253 : * PyThread_free_lock(self.lock)
8254 : */
8255 0 : goto __pyx_L6_break;
8256 :
8257 : /* "View.MemoryView":388
8258 : * if self.lock != NULL:
8259 : * for i in range(__pyx_memoryview_thread_locks_used):
8260 : * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
8261 : * __pyx_memoryview_thread_locks_used -= 1
8262 : * if i != __pyx_memoryview_thread_locks_used:
8263 : */
8264 : }
8265 : }
8266 : /*else*/ {
8267 :
8268 : /* "View.MemoryView":395
8269 : * break
8270 : * else:
8271 : * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
8272 : *
8273 : * cdef char *get_item_pointer(memoryview self, object index) except NULL:
8274 : */
8275 0 : PyThread_free_lock(__pyx_v_self->lock);
8276 : }
8277 0 : __pyx_L6_break:;
8278 :
8279 : /* "View.MemoryView":386
8280 : * cdef int i
8281 : * global __pyx_memoryview_thread_locks_used
8282 : * if self.lock != NULL: # <<<<<<<<<<<<<<
8283 : * for i in range(__pyx_memoryview_thread_locks_used):
8284 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8285 : */
8286 : }
8287 :
8288 : /* "View.MemoryView":376
8289 : * self.typeinfo = NULL
8290 : *
8291 : * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
8292 : * if self.obj is not None:
8293 : * __Pyx_ReleaseBuffer(&self.view)
8294 : */
8295 :
8296 : /* function exit code */
8297 0 : }
8298 :
8299 : /* "View.MemoryView":397
8300 : * PyThread_free_lock(self.lock)
8301 : *
8302 : * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
8303 : * cdef Py_ssize_t dim
8304 : * cdef char *itemp = <char *> self.view.buf
8305 : */
8306 :
8307 0 : static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8308 0 : Py_ssize_t __pyx_v_dim;
8309 0 : char *__pyx_v_itemp;
8310 0 : PyObject *__pyx_v_idx = NULL;
8311 0 : char *__pyx_r;
8312 : __Pyx_RefNannyDeclarations
8313 0 : Py_ssize_t __pyx_t_1;
8314 0 : PyObject *__pyx_t_2 = NULL;
8315 0 : Py_ssize_t __pyx_t_3;
8316 0 : PyObject *(*__pyx_t_4)(PyObject *);
8317 0 : PyObject *__pyx_t_5 = NULL;
8318 0 : Py_ssize_t __pyx_t_6;
8319 0 : char *__pyx_t_7;
8320 0 : int __pyx_lineno = 0;
8321 0 : const char *__pyx_filename = NULL;
8322 0 : int __pyx_clineno = 0;
8323 0 : __Pyx_RefNannySetupContext("get_item_pointer", 1);
8324 :
8325 : /* "View.MemoryView":399
8326 : * cdef char *get_item_pointer(memoryview self, object index) except NULL:
8327 : * cdef Py_ssize_t dim
8328 : * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
8329 : *
8330 : * for dim, idx in enumerate(index):
8331 : */
8332 0 : __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
8333 :
8334 : /* "View.MemoryView":401
8335 : * cdef char *itemp = <char *> self.view.buf
8336 : *
8337 : * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
8338 : * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8339 : *
8340 : */
8341 0 : __pyx_t_1 = 0;
8342 0 : if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
8343 0 : __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2);
8344 0 : __pyx_t_3 = 0;
8345 0 : __pyx_t_4 = NULL;
8346 : } else {
8347 0 : __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 401, __pyx_L1_error)
8348 0 : __Pyx_GOTREF(__pyx_t_2);
8349 0 : __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 401, __pyx_L1_error)
8350 : }
8351 0 : for (;;) {
8352 0 : if (likely(!__pyx_t_4)) {
8353 0 : if (likely(PyList_CheckExact(__pyx_t_2))) {
8354 : {
8355 0 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
8356 : #if !CYTHON_ASSUME_SAFE_MACROS
8357 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
8358 : #endif
8359 0 : if (__pyx_t_3 >= __pyx_temp) break;
8360 : }
8361 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8362 0 : __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
8363 : #else
8364 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 401, __pyx_L1_error)
8365 : __Pyx_GOTREF(__pyx_t_5);
8366 : #endif
8367 : } else {
8368 : {
8369 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
8370 : #if !CYTHON_ASSUME_SAFE_MACROS
8371 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
8372 : #endif
8373 0 : if (__pyx_t_3 >= __pyx_temp) break;
8374 : }
8375 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8376 0 : __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
8377 : #else
8378 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 401, __pyx_L1_error)
8379 : __Pyx_GOTREF(__pyx_t_5);
8380 : #endif
8381 : }
8382 : } else {
8383 0 : __pyx_t_5 = __pyx_t_4(__pyx_t_2);
8384 0 : if (unlikely(!__pyx_t_5)) {
8385 0 : PyObject* exc_type = PyErr_Occurred();
8386 0 : if (exc_type) {
8387 0 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
8388 0 : else __PYX_ERR(1, 401, __pyx_L1_error)
8389 : }
8390 : break;
8391 : }
8392 0 : __Pyx_GOTREF(__pyx_t_5);
8393 : }
8394 0 : __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
8395 0 : __pyx_t_5 = 0;
8396 0 : __pyx_v_dim = __pyx_t_1;
8397 0 : __pyx_t_1 = (__pyx_t_1 + 1);
8398 :
8399 : /* "View.MemoryView":402
8400 : *
8401 : * for dim, idx in enumerate(index):
8402 : * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
8403 : *
8404 : * return itemp
8405 : */
8406 0 : __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 402, __pyx_L1_error)
8407 0 : __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 402, __pyx_L1_error)
8408 : __pyx_v_itemp = __pyx_t_7;
8409 :
8410 : /* "View.MemoryView":401
8411 : * cdef char *itemp = <char *> self.view.buf
8412 : *
8413 : * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
8414 : * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8415 : *
8416 : */
8417 : }
8418 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8419 :
8420 : /* "View.MemoryView":404
8421 : * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8422 : *
8423 : * return itemp # <<<<<<<<<<<<<<
8424 : *
8425 : *
8426 : */
8427 0 : __pyx_r = __pyx_v_itemp;
8428 0 : goto __pyx_L0;
8429 :
8430 : /* "View.MemoryView":397
8431 : * PyThread_free_lock(self.lock)
8432 : *
8433 : * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
8434 : * cdef Py_ssize_t dim
8435 : * cdef char *itemp = <char *> self.view.buf
8436 : */
8437 :
8438 : /* function exit code */
8439 0 : __pyx_L1_error:;
8440 0 : __Pyx_XDECREF(__pyx_t_2);
8441 0 : __Pyx_XDECREF(__pyx_t_5);
8442 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
8443 0 : __pyx_r = NULL;
8444 0 : __pyx_L0:;
8445 0 : __Pyx_XDECREF(__pyx_v_idx);
8446 0 : __Pyx_RefNannyFinishContext();
8447 0 : return __pyx_r;
8448 : }
8449 :
8450 : /* "View.MemoryView":407
8451 : *
8452 : *
8453 : * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
8454 : * if index is Ellipsis:
8455 : * return self
8456 : */
8457 :
8458 : /* Python wrapper */
8459 : static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
8460 0 : static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
8461 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8462 0 : PyObject *__pyx_r = 0;
8463 : __Pyx_RefNannyDeclarations
8464 0 : __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
8465 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8466 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
8467 :
8468 : /* function exit code */
8469 0 : __Pyx_RefNannyFinishContext();
8470 0 : return __pyx_r;
8471 : }
8472 :
8473 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8474 0 : PyObject *__pyx_v_have_slices = NULL;
8475 0 : PyObject *__pyx_v_indices = NULL;
8476 0 : char *__pyx_v_itemp;
8477 0 : PyObject *__pyx_r = NULL;
8478 : __Pyx_RefNannyDeclarations
8479 0 : int __pyx_t_1;
8480 0 : PyObject *__pyx_t_2 = NULL;
8481 0 : PyObject *__pyx_t_3 = NULL;
8482 0 : PyObject *__pyx_t_4 = NULL;
8483 0 : char *__pyx_t_5;
8484 0 : int __pyx_lineno = 0;
8485 0 : const char *__pyx_filename = NULL;
8486 0 : int __pyx_clineno = 0;
8487 0 : __Pyx_RefNannySetupContext("__getitem__", 1);
8488 :
8489 : /* "View.MemoryView":408
8490 : *
8491 : * def __getitem__(memoryview self, object index):
8492 : * if index is Ellipsis: # <<<<<<<<<<<<<<
8493 : * return self
8494 : *
8495 : */
8496 0 : __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
8497 0 : if (__pyx_t_1) {
8498 :
8499 : /* "View.MemoryView":409
8500 : * def __getitem__(memoryview self, object index):
8501 : * if index is Ellipsis:
8502 : * return self # <<<<<<<<<<<<<<
8503 : *
8504 : * have_slices, indices = _unellipsify(index, self.view.ndim)
8505 : */
8506 0 : __Pyx_XDECREF(__pyx_r);
8507 0 : __Pyx_INCREF((PyObject *)__pyx_v_self);
8508 0 : __pyx_r = ((PyObject *)__pyx_v_self);
8509 0 : goto __pyx_L0;
8510 :
8511 : /* "View.MemoryView":408
8512 : *
8513 : * def __getitem__(memoryview self, object index):
8514 : * if index is Ellipsis: # <<<<<<<<<<<<<<
8515 : * return self
8516 : *
8517 : */
8518 : }
8519 :
8520 : /* "View.MemoryView":411
8521 : * return self
8522 : *
8523 : * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
8524 : *
8525 : * cdef char *itemp
8526 : */
8527 0 : __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 411, __pyx_L1_error)
8528 0 : __Pyx_GOTREF(__pyx_t_2);
8529 0 : if (likely(__pyx_t_2 != Py_None)) {
8530 0 : PyObject* sequence = __pyx_t_2;
8531 0 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8532 0 : if (unlikely(size != 2)) {
8533 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8534 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8535 0 : __PYX_ERR(1, 411, __pyx_L1_error)
8536 : }
8537 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8538 0 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
8539 0 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
8540 0 : __Pyx_INCREF(__pyx_t_3);
8541 0 : __Pyx_INCREF(__pyx_t_4);
8542 : #else
8543 : __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
8544 : __Pyx_GOTREF(__pyx_t_3);
8545 : __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 411, __pyx_L1_error)
8546 : __Pyx_GOTREF(__pyx_t_4);
8547 : #endif
8548 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8549 : } else {
8550 0 : __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 411, __pyx_L1_error)
8551 : }
8552 0 : __pyx_v_have_slices = __pyx_t_3;
8553 0 : __pyx_t_3 = 0;
8554 0 : __pyx_v_indices = __pyx_t_4;
8555 0 : __pyx_t_4 = 0;
8556 :
8557 : /* "View.MemoryView":414
8558 : *
8559 : * cdef char *itemp
8560 : * if have_slices: # <<<<<<<<<<<<<<
8561 : * return memview_slice(self, indices)
8562 : * else:
8563 : */
8564 0 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 414, __pyx_L1_error)
8565 0 : if (__pyx_t_1) {
8566 :
8567 : /* "View.MemoryView":415
8568 : * cdef char *itemp
8569 : * if have_slices:
8570 : * return memview_slice(self, indices) # <<<<<<<<<<<<<<
8571 : * else:
8572 : * itemp = self.get_item_pointer(indices)
8573 : */
8574 0 : __Pyx_XDECREF(__pyx_r);
8575 0 : __pyx_t_2 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 415, __pyx_L1_error)
8576 0 : __Pyx_GOTREF(__pyx_t_2);
8577 0 : __pyx_r = __pyx_t_2;
8578 0 : __pyx_t_2 = 0;
8579 0 : goto __pyx_L0;
8580 :
8581 : /* "View.MemoryView":414
8582 : *
8583 : * cdef char *itemp
8584 : * if have_slices: # <<<<<<<<<<<<<<
8585 : * return memview_slice(self, indices)
8586 : * else:
8587 : */
8588 : }
8589 :
8590 : /* "View.MemoryView":417
8591 : * return memview_slice(self, indices)
8592 : * else:
8593 : * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
8594 : * return self.convert_item_to_object(itemp)
8595 : *
8596 : */
8597 : /*else*/ {
8598 0 : __pyx_t_5 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_5 == ((char *)NULL))) __PYX_ERR(1, 417, __pyx_L1_error)
8599 0 : __pyx_v_itemp = __pyx_t_5;
8600 :
8601 : /* "View.MemoryView":418
8602 : * else:
8603 : * itemp = self.get_item_pointer(indices)
8604 : * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
8605 : *
8606 : * def __setitem__(memoryview self, object index, object value):
8607 : */
8608 0 : __Pyx_XDECREF(__pyx_r);
8609 0 : __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
8610 0 : __Pyx_GOTREF(__pyx_t_2);
8611 0 : __pyx_r = __pyx_t_2;
8612 0 : __pyx_t_2 = 0;
8613 0 : goto __pyx_L0;
8614 : }
8615 :
8616 : /* "View.MemoryView":407
8617 : *
8618 : *
8619 : * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
8620 : * if index is Ellipsis:
8621 : * return self
8622 : */
8623 :
8624 : /* function exit code */
8625 0 : __pyx_L1_error:;
8626 0 : __Pyx_XDECREF(__pyx_t_2);
8627 0 : __Pyx_XDECREF(__pyx_t_3);
8628 0 : __Pyx_XDECREF(__pyx_t_4);
8629 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8630 0 : __pyx_r = NULL;
8631 0 : __pyx_L0:;
8632 0 : __Pyx_XDECREF(__pyx_v_have_slices);
8633 0 : __Pyx_XDECREF(__pyx_v_indices);
8634 0 : __Pyx_XGIVEREF(__pyx_r);
8635 0 : __Pyx_RefNannyFinishContext();
8636 0 : return __pyx_r;
8637 : }
8638 :
8639 : /* "View.MemoryView":420
8640 : * return self.convert_item_to_object(itemp)
8641 : *
8642 : * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
8643 : * if self.view.readonly:
8644 : * raise TypeError, "Cannot assign to read-only memoryview"
8645 : */
8646 :
8647 : /* Python wrapper */
8648 : static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
8649 0 : static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
8650 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8651 0 : int __pyx_r;
8652 : __Pyx_RefNannyDeclarations
8653 0 : __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
8654 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8655 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
8656 :
8657 : /* function exit code */
8658 0 : __Pyx_RefNannyFinishContext();
8659 0 : return __pyx_r;
8660 : }
8661 :
8662 0 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
8663 0 : PyObject *__pyx_v_have_slices = NULL;
8664 0 : PyObject *__pyx_v_obj = NULL;
8665 0 : int __pyx_r;
8666 : __Pyx_RefNannyDeclarations
8667 0 : PyObject *__pyx_t_1 = NULL;
8668 0 : PyObject *__pyx_t_2 = NULL;
8669 0 : PyObject *__pyx_t_3 = NULL;
8670 0 : int __pyx_t_4;
8671 0 : int __pyx_lineno = 0;
8672 0 : const char *__pyx_filename = NULL;
8673 0 : int __pyx_clineno = 0;
8674 0 : __Pyx_RefNannySetupContext("__setitem__", 0);
8675 0 : __Pyx_INCREF(__pyx_v_index);
8676 :
8677 : /* "View.MemoryView":421
8678 : *
8679 : * def __setitem__(memoryview self, object index, object value):
8680 : * if self.view.readonly: # <<<<<<<<<<<<<<
8681 : * raise TypeError, "Cannot assign to read-only memoryview"
8682 : *
8683 : */
8684 0 : if (unlikely(__pyx_v_self->view.readonly)) {
8685 :
8686 : /* "View.MemoryView":422
8687 : * def __setitem__(memoryview self, object index, object value):
8688 : * if self.view.readonly:
8689 : * raise TypeError, "Cannot assign to read-only memoryview" # <<<<<<<<<<<<<<
8690 : *
8691 : * have_slices, index = _unellipsify(index, self.view.ndim)
8692 : */
8693 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_Cannot_assign_to_read_only_memor, 0, 0);
8694 0 : __PYX_ERR(1, 422, __pyx_L1_error)
8695 :
8696 : /* "View.MemoryView":421
8697 : *
8698 : * def __setitem__(memoryview self, object index, object value):
8699 : * if self.view.readonly: # <<<<<<<<<<<<<<
8700 : * raise TypeError, "Cannot assign to read-only memoryview"
8701 : *
8702 : */
8703 : }
8704 :
8705 : /* "View.MemoryView":424
8706 : * raise TypeError, "Cannot assign to read-only memoryview"
8707 : *
8708 : * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
8709 : *
8710 : * if have_slices:
8711 : */
8712 0 : __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 424, __pyx_L1_error)
8713 0 : __Pyx_GOTREF(__pyx_t_1);
8714 0 : if (likely(__pyx_t_1 != Py_None)) {
8715 0 : PyObject* sequence = __pyx_t_1;
8716 0 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8717 0 : if (unlikely(size != 2)) {
8718 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8719 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8720 0 : __PYX_ERR(1, 424, __pyx_L1_error)
8721 : }
8722 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8723 0 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
8724 0 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
8725 0 : __Pyx_INCREF(__pyx_t_2);
8726 0 : __Pyx_INCREF(__pyx_t_3);
8727 : #else
8728 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 424, __pyx_L1_error)
8729 : __Pyx_GOTREF(__pyx_t_2);
8730 : __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 424, __pyx_L1_error)
8731 : __Pyx_GOTREF(__pyx_t_3);
8732 : #endif
8733 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8734 : } else {
8735 0 : __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 424, __pyx_L1_error)
8736 : }
8737 0 : __pyx_v_have_slices = __pyx_t_2;
8738 0 : __pyx_t_2 = 0;
8739 0 : __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3);
8740 0 : __pyx_t_3 = 0;
8741 :
8742 : /* "View.MemoryView":426
8743 : * have_slices, index = _unellipsify(index, self.view.ndim)
8744 : *
8745 : * if have_slices: # <<<<<<<<<<<<<<
8746 : * obj = self.is_slice(value)
8747 : * if obj is not None:
8748 : */
8749 0 : __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 426, __pyx_L1_error)
8750 0 : if (__pyx_t_4) {
8751 :
8752 : /* "View.MemoryView":427
8753 : *
8754 : * if have_slices:
8755 : * obj = self.is_slice(value) # <<<<<<<<<<<<<<
8756 : * if obj is not None:
8757 : * self.setitem_slice_assignment(self[index], obj)
8758 : */
8759 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 427, __pyx_L1_error)
8760 0 : __Pyx_GOTREF(__pyx_t_1);
8761 0 : __pyx_v_obj = __pyx_t_1;
8762 0 : __pyx_t_1 = 0;
8763 :
8764 : /* "View.MemoryView":428
8765 : * if have_slices:
8766 : * obj = self.is_slice(value)
8767 : * if obj is not None: # <<<<<<<<<<<<<<
8768 : * self.setitem_slice_assignment(self[index], obj)
8769 : * else:
8770 : */
8771 0 : __pyx_t_4 = (__pyx_v_obj != Py_None);
8772 0 : if (__pyx_t_4) {
8773 :
8774 : /* "View.MemoryView":429
8775 : * obj = self.is_slice(value)
8776 : * if obj is not None:
8777 : * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
8778 : * else:
8779 : * self.setitem_slice_assign_scalar(self[index], value)
8780 : */
8781 0 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 429, __pyx_L1_error)
8782 0 : __Pyx_GOTREF(__pyx_t_1);
8783 0 : __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 429, __pyx_L1_error)
8784 0 : __Pyx_GOTREF(__pyx_t_3);
8785 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8786 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8787 :
8788 : /* "View.MemoryView":428
8789 : * if have_slices:
8790 : * obj = self.is_slice(value)
8791 : * if obj is not None: # <<<<<<<<<<<<<<
8792 : * self.setitem_slice_assignment(self[index], obj)
8793 : * else:
8794 : */
8795 0 : goto __pyx_L5;
8796 : }
8797 :
8798 : /* "View.MemoryView":431
8799 : * self.setitem_slice_assignment(self[index], obj)
8800 : * else:
8801 : * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
8802 : * else:
8803 : * self.setitem_indexed(index, value)
8804 : */
8805 : /*else*/ {
8806 0 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 431, __pyx_L1_error)
8807 0 : __Pyx_GOTREF(__pyx_t_3);
8808 0 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 431, __pyx_L1_error)
8809 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 431, __pyx_L1_error)
8810 0 : __Pyx_GOTREF(__pyx_t_1);
8811 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8812 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8813 : }
8814 0 : __pyx_L5:;
8815 :
8816 : /* "View.MemoryView":426
8817 : * have_slices, index = _unellipsify(index, self.view.ndim)
8818 : *
8819 : * if have_slices: # <<<<<<<<<<<<<<
8820 : * obj = self.is_slice(value)
8821 : * if obj is not None:
8822 : */
8823 0 : goto __pyx_L4;
8824 : }
8825 :
8826 : /* "View.MemoryView":433
8827 : * self.setitem_slice_assign_scalar(self[index], value)
8828 : * else:
8829 : * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
8830 : *
8831 : * cdef is_slice(self, obj):
8832 : */
8833 : /*else*/ {
8834 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 433, __pyx_L1_error)
8835 0 : __Pyx_GOTREF(__pyx_t_1);
8836 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8837 : }
8838 0 : __pyx_L4:;
8839 :
8840 : /* "View.MemoryView":420
8841 : * return self.convert_item_to_object(itemp)
8842 : *
8843 : * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
8844 : * if self.view.readonly:
8845 : * raise TypeError, "Cannot assign to read-only memoryview"
8846 : */
8847 :
8848 : /* function exit code */
8849 0 : __pyx_r = 0;
8850 0 : goto __pyx_L0;
8851 0 : __pyx_L1_error:;
8852 0 : __Pyx_XDECREF(__pyx_t_1);
8853 0 : __Pyx_XDECREF(__pyx_t_2);
8854 0 : __Pyx_XDECREF(__pyx_t_3);
8855 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8856 0 : __pyx_r = -1;
8857 0 : __pyx_L0:;
8858 0 : __Pyx_XDECREF(__pyx_v_have_slices);
8859 0 : __Pyx_XDECREF(__pyx_v_obj);
8860 0 : __Pyx_XDECREF(__pyx_v_index);
8861 0 : __Pyx_RefNannyFinishContext();
8862 0 : return __pyx_r;
8863 : }
8864 :
8865 : /* "View.MemoryView":435
8866 : * self.setitem_indexed(index, value)
8867 : *
8868 : * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
8869 : * if not isinstance(obj, memoryview):
8870 : * try:
8871 : */
8872 :
8873 0 : static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
8874 0 : PyObject *__pyx_r = NULL;
8875 : __Pyx_RefNannyDeclarations
8876 0 : int __pyx_t_1;
8877 0 : int __pyx_t_2;
8878 0 : PyObject *__pyx_t_3 = NULL;
8879 0 : PyObject *__pyx_t_4 = NULL;
8880 0 : PyObject *__pyx_t_5 = NULL;
8881 0 : PyObject *__pyx_t_6 = NULL;
8882 0 : PyObject *__pyx_t_7 = NULL;
8883 0 : PyObject *__pyx_t_8 = NULL;
8884 0 : int __pyx_t_9;
8885 0 : int __pyx_lineno = 0;
8886 0 : const char *__pyx_filename = NULL;
8887 0 : int __pyx_clineno = 0;
8888 0 : __Pyx_RefNannySetupContext("is_slice", 0);
8889 0 : __Pyx_INCREF(__pyx_v_obj);
8890 :
8891 : /* "View.MemoryView":436
8892 : *
8893 : * cdef is_slice(self, obj):
8894 : * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
8895 : * try:
8896 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8897 : */
8898 0 : __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
8899 0 : __pyx_t_2 = (!__pyx_t_1);
8900 0 : if (__pyx_t_2) {
8901 :
8902 : /* "View.MemoryView":437
8903 : * cdef is_slice(self, obj):
8904 : * if not isinstance(obj, memoryview):
8905 : * try: # <<<<<<<<<<<<<<
8906 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8907 : * self.dtype_is_object)
8908 : */
8909 : {
8910 0 : __Pyx_PyThreadState_declare
8911 0 : __Pyx_PyThreadState_assign
8912 0 : __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
8913 0 : __Pyx_XGOTREF(__pyx_t_3);
8914 0 : __Pyx_XGOTREF(__pyx_t_4);
8915 0 : __Pyx_XGOTREF(__pyx_t_5);
8916 : /*try:*/ {
8917 :
8918 : /* "View.MemoryView":438
8919 : * if not isinstance(obj, memoryview):
8920 : * try:
8921 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
8922 : * self.dtype_is_object)
8923 : * except TypeError:
8924 : */
8925 0 : __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 438, __pyx_L4_error)
8926 0 : __Pyx_GOTREF(__pyx_t_6);
8927 :
8928 : /* "View.MemoryView":439
8929 : * try:
8930 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8931 : * self.dtype_is_object) # <<<<<<<<<<<<<<
8932 : * except TypeError:
8933 : * return None
8934 : */
8935 0 : __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 439, __pyx_L4_error)
8936 0 : __Pyx_GOTREF(__pyx_t_7);
8937 :
8938 : /* "View.MemoryView":438
8939 : * if not isinstance(obj, memoryview):
8940 : * try:
8941 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
8942 : * self.dtype_is_object)
8943 : * except TypeError:
8944 : */
8945 0 : __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 438, __pyx_L4_error)
8946 0 : __Pyx_GOTREF(__pyx_t_8);
8947 0 : __Pyx_INCREF(__pyx_v_obj);
8948 0 : __Pyx_GIVEREF(__pyx_v_obj);
8949 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj)) __PYX_ERR(1, 438, __pyx_L4_error);
8950 0 : __Pyx_GIVEREF(__pyx_t_6);
8951 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6)) __PYX_ERR(1, 438, __pyx_L4_error);
8952 0 : __Pyx_GIVEREF(__pyx_t_7);
8953 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7)) __PYX_ERR(1, 438, __pyx_L4_error);
8954 0 : __pyx_t_6 = 0;
8955 0 : __pyx_t_7 = 0;
8956 0 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 438, __pyx_L4_error)
8957 0 : __Pyx_GOTREF(__pyx_t_7);
8958 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8959 0 : __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
8960 0 : __pyx_t_7 = 0;
8961 :
8962 : /* "View.MemoryView":437
8963 : * cdef is_slice(self, obj):
8964 : * if not isinstance(obj, memoryview):
8965 : * try: # <<<<<<<<<<<<<<
8966 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8967 : * self.dtype_is_object)
8968 : */
8969 : }
8970 0 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8971 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8972 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8973 0 : goto __pyx_L9_try_end;
8974 0 : __pyx_L4_error:;
8975 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8976 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8977 0 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
8978 :
8979 : /* "View.MemoryView":440
8980 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8981 : * self.dtype_is_object)
8982 : * except TypeError: # <<<<<<<<<<<<<<
8983 : * return None
8984 : *
8985 : */
8986 0 : __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
8987 0 : if (__pyx_t_9) {
8988 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
8989 0 : if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 440, __pyx_L6_except_error)
8990 0 : __Pyx_XGOTREF(__pyx_t_7);
8991 0 : __Pyx_XGOTREF(__pyx_t_8);
8992 0 : __Pyx_XGOTREF(__pyx_t_6);
8993 :
8994 : /* "View.MemoryView":441
8995 : * self.dtype_is_object)
8996 : * except TypeError:
8997 : * return None # <<<<<<<<<<<<<<
8998 : *
8999 : * return obj
9000 : */
9001 0 : __Pyx_XDECREF(__pyx_r);
9002 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9003 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9004 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9005 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9006 0 : goto __pyx_L7_except_return;
9007 : }
9008 0 : goto __pyx_L6_except_error;
9009 :
9010 : /* "View.MemoryView":437
9011 : * cdef is_slice(self, obj):
9012 : * if not isinstance(obj, memoryview):
9013 : * try: # <<<<<<<<<<<<<<
9014 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9015 : * self.dtype_is_object)
9016 : */
9017 0 : __pyx_L6_except_error:;
9018 0 : __Pyx_XGIVEREF(__pyx_t_3);
9019 0 : __Pyx_XGIVEREF(__pyx_t_4);
9020 0 : __Pyx_XGIVEREF(__pyx_t_5);
9021 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9022 0 : goto __pyx_L1_error;
9023 0 : __pyx_L7_except_return:;
9024 0 : __Pyx_XGIVEREF(__pyx_t_3);
9025 0 : __Pyx_XGIVEREF(__pyx_t_4);
9026 0 : __Pyx_XGIVEREF(__pyx_t_5);
9027 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9028 0 : goto __pyx_L0;
9029 0 : __pyx_L9_try_end:;
9030 : }
9031 :
9032 : /* "View.MemoryView":436
9033 : *
9034 : * cdef is_slice(self, obj):
9035 : * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
9036 : * try:
9037 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9038 : */
9039 : }
9040 :
9041 : /* "View.MemoryView":443
9042 : * return None
9043 : *
9044 : * return obj # <<<<<<<<<<<<<<
9045 : *
9046 : * cdef setitem_slice_assignment(self, dst, src):
9047 : */
9048 0 : __Pyx_XDECREF(__pyx_r);
9049 0 : __Pyx_INCREF(__pyx_v_obj);
9050 0 : __pyx_r = __pyx_v_obj;
9051 0 : goto __pyx_L0;
9052 :
9053 : /* "View.MemoryView":435
9054 : * self.setitem_indexed(index, value)
9055 : *
9056 : * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
9057 : * if not isinstance(obj, memoryview):
9058 : * try:
9059 : */
9060 :
9061 : /* function exit code */
9062 0 : __pyx_L1_error:;
9063 0 : __Pyx_XDECREF(__pyx_t_6);
9064 0 : __Pyx_XDECREF(__pyx_t_7);
9065 0 : __Pyx_XDECREF(__pyx_t_8);
9066 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
9067 0 : __pyx_r = 0;
9068 0 : __pyx_L0:;
9069 0 : __Pyx_XDECREF(__pyx_v_obj);
9070 0 : __Pyx_XGIVEREF(__pyx_r);
9071 0 : __Pyx_RefNannyFinishContext();
9072 0 : return __pyx_r;
9073 : }
9074 :
9075 : /* "View.MemoryView":445
9076 : * return obj
9077 : *
9078 : * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
9079 : * cdef __Pyx_memviewslice dst_slice
9080 : * cdef __Pyx_memviewslice src_slice
9081 : */
9082 :
9083 0 : static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
9084 0 : __Pyx_memviewslice __pyx_v_dst_slice;
9085 0 : __Pyx_memviewslice __pyx_v_src_slice;
9086 0 : __Pyx_memviewslice __pyx_v_msrc;
9087 0 : __Pyx_memviewslice __pyx_v_mdst;
9088 0 : PyObject *__pyx_r = NULL;
9089 : __Pyx_RefNannyDeclarations
9090 0 : __Pyx_memviewslice *__pyx_t_1;
9091 0 : PyObject *__pyx_t_2 = NULL;
9092 0 : int __pyx_t_3;
9093 0 : int __pyx_t_4;
9094 0 : int __pyx_t_5;
9095 0 : int __pyx_lineno = 0;
9096 0 : const char *__pyx_filename = NULL;
9097 0 : int __pyx_clineno = 0;
9098 0 : __Pyx_RefNannySetupContext("setitem_slice_assignment", 1);
9099 :
9100 : /* "View.MemoryView":448
9101 : * cdef __Pyx_memviewslice dst_slice
9102 : * cdef __Pyx_memviewslice src_slice
9103 : * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0] # <<<<<<<<<<<<<<
9104 : * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
9105 : *
9106 : */
9107 0 : if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 448, __pyx_L1_error)
9108 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 448, __pyx_L1_error)
9109 0 : __pyx_v_msrc = (__pyx_t_1[0]);
9110 :
9111 : /* "View.MemoryView":449
9112 : * cdef __Pyx_memviewslice src_slice
9113 : * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0]
9114 : * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0] # <<<<<<<<<<<<<<
9115 : *
9116 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
9117 : */
9118 0 : if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 449, __pyx_L1_error)
9119 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 449, __pyx_L1_error)
9120 0 : __pyx_v_mdst = (__pyx_t_1[0]);
9121 :
9122 : /* "View.MemoryView":451
9123 : * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
9124 : *
9125 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
9126 : *
9127 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
9128 : */
9129 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 451, __pyx_L1_error)
9130 0 : __Pyx_GOTREF(__pyx_t_2);
9131 0 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 451, __pyx_L1_error)
9132 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9133 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 451, __pyx_L1_error)
9134 0 : __Pyx_GOTREF(__pyx_t_2);
9135 0 : __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 451, __pyx_L1_error)
9136 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9137 0 : __pyx_t_5 = __pyx_memoryview_copy_contents(__pyx_v_msrc, __pyx_v_mdst, __pyx_t_3, __pyx_t_4, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 451, __pyx_L1_error)
9138 :
9139 : /* "View.MemoryView":445
9140 : * return obj
9141 : *
9142 : * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
9143 : * cdef __Pyx_memviewslice dst_slice
9144 : * cdef __Pyx_memviewslice src_slice
9145 : */
9146 :
9147 : /* function exit code */
9148 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9149 0 : goto __pyx_L0;
9150 0 : __pyx_L1_error:;
9151 0 : __Pyx_XDECREF(__pyx_t_2);
9152 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
9153 0 : __pyx_r = 0;
9154 0 : __pyx_L0:;
9155 0 : __Pyx_XGIVEREF(__pyx_r);
9156 0 : __Pyx_RefNannyFinishContext();
9157 0 : return __pyx_r;
9158 : }
9159 :
9160 : /* "View.MemoryView":453
9161 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
9162 : *
9163 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
9164 : * cdef int array[128]
9165 : * cdef void *tmp = NULL
9166 : */
9167 :
9168 0 : static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
9169 0 : int __pyx_v_array[0x80];
9170 0 : void *__pyx_v_tmp;
9171 0 : void *__pyx_v_item;
9172 0 : __Pyx_memviewslice *__pyx_v_dst_slice;
9173 0 : __Pyx_memviewslice __pyx_v_tmp_slice;
9174 0 : PyObject *__pyx_r = NULL;
9175 : __Pyx_RefNannyDeclarations
9176 0 : __Pyx_memviewslice *__pyx_t_1;
9177 0 : int __pyx_t_2;
9178 0 : PyObject *__pyx_t_3 = NULL;
9179 0 : int __pyx_t_4;
9180 0 : int __pyx_t_5;
9181 0 : char const *__pyx_t_6;
9182 0 : PyObject *__pyx_t_7 = NULL;
9183 0 : PyObject *__pyx_t_8 = NULL;
9184 0 : PyObject *__pyx_t_9 = NULL;
9185 0 : PyObject *__pyx_t_10 = NULL;
9186 0 : PyObject *__pyx_t_11 = NULL;
9187 0 : PyObject *__pyx_t_12 = NULL;
9188 0 : int __pyx_lineno = 0;
9189 0 : const char *__pyx_filename = NULL;
9190 0 : int __pyx_clineno = 0;
9191 0 : __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 1);
9192 :
9193 : /* "View.MemoryView":455
9194 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
9195 : * cdef int array[128]
9196 : * cdef void *tmp = NULL # <<<<<<<<<<<<<<
9197 : * cdef void *item
9198 : *
9199 : */
9200 0 : __pyx_v_tmp = NULL;
9201 :
9202 : /* "View.MemoryView":460
9203 : * cdef __Pyx_memviewslice *dst_slice
9204 : * cdef __Pyx_memviewslice tmp_slice
9205 : * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
9206 : *
9207 : * if <size_t>self.view.itemsize > sizeof(array):
9208 : */
9209 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 460, __pyx_L1_error)
9210 0 : __pyx_v_dst_slice = __pyx_t_1;
9211 :
9212 : /* "View.MemoryView":462
9213 : * dst_slice = get_slice_from_memview(dst, &tmp_slice)
9214 : *
9215 : * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
9216 : * tmp = PyMem_Malloc(self.view.itemsize)
9217 : * if tmp == NULL:
9218 : */
9219 0 : __pyx_t_2 = (((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array)));
9220 0 : if (__pyx_t_2) {
9221 :
9222 : /* "View.MemoryView":463
9223 : *
9224 : * if <size_t>self.view.itemsize > sizeof(array):
9225 : * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
9226 : * if tmp == NULL:
9227 : * raise MemoryError
9228 : */
9229 0 : __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
9230 :
9231 : /* "View.MemoryView":464
9232 : * if <size_t>self.view.itemsize > sizeof(array):
9233 : * tmp = PyMem_Malloc(self.view.itemsize)
9234 : * if tmp == NULL: # <<<<<<<<<<<<<<
9235 : * raise MemoryError
9236 : * item = tmp
9237 : */
9238 0 : __pyx_t_2 = (__pyx_v_tmp == NULL);
9239 0 : if (unlikely(__pyx_t_2)) {
9240 :
9241 : /* "View.MemoryView":465
9242 : * tmp = PyMem_Malloc(self.view.itemsize)
9243 : * if tmp == NULL:
9244 : * raise MemoryError # <<<<<<<<<<<<<<
9245 : * item = tmp
9246 : * else:
9247 : */
9248 0 : PyErr_NoMemory(); __PYX_ERR(1, 465, __pyx_L1_error)
9249 :
9250 : /* "View.MemoryView":464
9251 : * if <size_t>self.view.itemsize > sizeof(array):
9252 : * tmp = PyMem_Malloc(self.view.itemsize)
9253 : * if tmp == NULL: # <<<<<<<<<<<<<<
9254 : * raise MemoryError
9255 : * item = tmp
9256 : */
9257 : }
9258 :
9259 : /* "View.MemoryView":466
9260 : * if tmp == NULL:
9261 : * raise MemoryError
9262 : * item = tmp # <<<<<<<<<<<<<<
9263 : * else:
9264 : * item = <void *> array
9265 : */
9266 0 : __pyx_v_item = __pyx_v_tmp;
9267 :
9268 : /* "View.MemoryView":462
9269 : * dst_slice = get_slice_from_memview(dst, &tmp_slice)
9270 : *
9271 : * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
9272 : * tmp = PyMem_Malloc(self.view.itemsize)
9273 : * if tmp == NULL:
9274 : */
9275 0 : goto __pyx_L3;
9276 : }
9277 :
9278 : /* "View.MemoryView":468
9279 : * item = tmp
9280 : * else:
9281 : * item = <void *> array # <<<<<<<<<<<<<<
9282 : *
9283 : * try:
9284 : */
9285 : /*else*/ {
9286 : __pyx_v_item = ((void *)__pyx_v_array);
9287 : }
9288 0 : __pyx_L3:;
9289 :
9290 : /* "View.MemoryView":470
9291 : * item = <void *> array
9292 : *
9293 : * try: # <<<<<<<<<<<<<<
9294 : * if self.dtype_is_object:
9295 : * (<PyObject **> item)[0] = <PyObject *> value
9296 : */
9297 : /*try:*/ {
9298 :
9299 : /* "View.MemoryView":471
9300 : *
9301 : * try:
9302 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
9303 : * (<PyObject **> item)[0] = <PyObject *> value
9304 : * else:
9305 : */
9306 0 : if (__pyx_v_self->dtype_is_object) {
9307 :
9308 : /* "View.MemoryView":472
9309 : * try:
9310 : * if self.dtype_is_object:
9311 : * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
9312 : * else:
9313 : * self.assign_item_from_object(<char *> item, value)
9314 : */
9315 0 : (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
9316 :
9317 : /* "View.MemoryView":471
9318 : *
9319 : * try:
9320 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
9321 : * (<PyObject **> item)[0] = <PyObject *> value
9322 : * else:
9323 : */
9324 0 : goto __pyx_L8;
9325 : }
9326 :
9327 : /* "View.MemoryView":474
9328 : * (<PyObject **> item)[0] = <PyObject *> value
9329 : * else:
9330 : * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
9331 : *
9332 : *
9333 : */
9334 : /*else*/ {
9335 0 : __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 474, __pyx_L6_error)
9336 0 : __Pyx_GOTREF(__pyx_t_3);
9337 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9338 : }
9339 0 : __pyx_L8:;
9340 :
9341 : /* "View.MemoryView":478
9342 : *
9343 : *
9344 : * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
9345 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9346 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
9347 : */
9348 0 : __pyx_t_2 = (__pyx_v_self->view.suboffsets != NULL);
9349 0 : if (__pyx_t_2) {
9350 :
9351 : /* "View.MemoryView":479
9352 : *
9353 : * if self.view.suboffsets != NULL:
9354 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
9355 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
9356 : * item, self.dtype_is_object)
9357 : */
9358 0 : __pyx_t_4 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 479, __pyx_L6_error)
9359 :
9360 : /* "View.MemoryView":478
9361 : *
9362 : *
9363 : * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
9364 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9365 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
9366 : */
9367 : }
9368 :
9369 : /* "View.MemoryView":480
9370 : * if self.view.suboffsets != NULL:
9371 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9372 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
9373 : * item, self.dtype_is_object)
9374 : * finally:
9375 : */
9376 0 : __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
9377 : }
9378 :
9379 : /* "View.MemoryView":483
9380 : * item, self.dtype_is_object)
9381 : * finally:
9382 : * PyMem_Free(tmp) # <<<<<<<<<<<<<<
9383 : *
9384 : * cdef setitem_indexed(self, index, value):
9385 : */
9386 : /*finally:*/ {
9387 : /*normal exit:*/{
9388 0 : PyMem_Free(__pyx_v_tmp);
9389 0 : goto __pyx_L7;
9390 : }
9391 0 : __pyx_L6_error:;
9392 : /*exception exit:*/{
9393 0 : __Pyx_PyThreadState_declare
9394 0 : __Pyx_PyThreadState_assign
9395 0 : __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9396 0 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9397 0 : if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
9398 0 : if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
9399 0 : __Pyx_XGOTREF(__pyx_t_7);
9400 0 : __Pyx_XGOTREF(__pyx_t_8);
9401 0 : __Pyx_XGOTREF(__pyx_t_9);
9402 0 : __Pyx_XGOTREF(__pyx_t_10);
9403 0 : __Pyx_XGOTREF(__pyx_t_11);
9404 0 : __Pyx_XGOTREF(__pyx_t_12);
9405 0 : __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
9406 : {
9407 0 : PyMem_Free(__pyx_v_tmp);
9408 : }
9409 0 : if (PY_MAJOR_VERSION >= 3) {
9410 0 : __Pyx_XGIVEREF(__pyx_t_10);
9411 0 : __Pyx_XGIVEREF(__pyx_t_11);
9412 0 : __Pyx_XGIVEREF(__pyx_t_12);
9413 0 : __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
9414 : }
9415 0 : __Pyx_XGIVEREF(__pyx_t_7);
9416 0 : __Pyx_XGIVEREF(__pyx_t_8);
9417 0 : __Pyx_XGIVEREF(__pyx_t_9);
9418 0 : __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
9419 0 : __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9420 0 : __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
9421 0 : goto __pyx_L1_error;
9422 : }
9423 0 : __pyx_L7:;
9424 : }
9425 :
9426 : /* "View.MemoryView":453
9427 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
9428 : *
9429 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
9430 : * cdef int array[128]
9431 : * cdef void *tmp = NULL
9432 : */
9433 :
9434 : /* function exit code */
9435 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9436 0 : goto __pyx_L0;
9437 0 : __pyx_L1_error:;
9438 0 : __Pyx_XDECREF(__pyx_t_3);
9439 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9440 0 : __pyx_r = 0;
9441 0 : __pyx_L0:;
9442 0 : __Pyx_XGIVEREF(__pyx_r);
9443 0 : __Pyx_RefNannyFinishContext();
9444 0 : return __pyx_r;
9445 : }
9446 :
9447 : /* "View.MemoryView":485
9448 : * PyMem_Free(tmp)
9449 : *
9450 : * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
9451 : * cdef char *itemp = self.get_item_pointer(index)
9452 : * self.assign_item_from_object(itemp, value)
9453 : */
9454 :
9455 0 : static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9456 0 : char *__pyx_v_itemp;
9457 0 : PyObject *__pyx_r = NULL;
9458 : __Pyx_RefNannyDeclarations
9459 0 : char *__pyx_t_1;
9460 0 : PyObject *__pyx_t_2 = NULL;
9461 0 : int __pyx_lineno = 0;
9462 0 : const char *__pyx_filename = NULL;
9463 0 : int __pyx_clineno = 0;
9464 0 : __Pyx_RefNannySetupContext("setitem_indexed", 1);
9465 :
9466 : /* "View.MemoryView":486
9467 : *
9468 : * cdef setitem_indexed(self, index, value):
9469 : * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
9470 : * self.assign_item_from_object(itemp, value)
9471 : *
9472 : */
9473 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 486, __pyx_L1_error)
9474 0 : __pyx_v_itemp = __pyx_t_1;
9475 :
9476 : /* "View.MemoryView":487
9477 : * cdef setitem_indexed(self, index, value):
9478 : * cdef char *itemp = self.get_item_pointer(index)
9479 : * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
9480 : *
9481 : * cdef convert_item_to_object(self, char *itemp):
9482 : */
9483 0 : __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 487, __pyx_L1_error)
9484 0 : __Pyx_GOTREF(__pyx_t_2);
9485 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9486 :
9487 : /* "View.MemoryView":485
9488 : * PyMem_Free(tmp)
9489 : *
9490 : * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
9491 : * cdef char *itemp = self.get_item_pointer(index)
9492 : * self.assign_item_from_object(itemp, value)
9493 : */
9494 :
9495 : /* function exit code */
9496 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9497 0 : goto __pyx_L0;
9498 0 : __pyx_L1_error:;
9499 0 : __Pyx_XDECREF(__pyx_t_2);
9500 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
9501 0 : __pyx_r = 0;
9502 0 : __pyx_L0:;
9503 0 : __Pyx_XGIVEREF(__pyx_r);
9504 0 : __Pyx_RefNannyFinishContext();
9505 0 : return __pyx_r;
9506 : }
9507 :
9508 : /* "View.MemoryView":489
9509 : * self.assign_item_from_object(itemp, value)
9510 : *
9511 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
9512 : * """Only used if instantiated manually by the user, or if Cython doesn't
9513 : * know how to convert the type"""
9514 : */
9515 :
9516 0 : static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
9517 0 : PyObject *__pyx_v_struct = NULL;
9518 0 : PyObject *__pyx_v_bytesitem = 0;
9519 0 : PyObject *__pyx_v_result = NULL;
9520 0 : PyObject *__pyx_r = NULL;
9521 : __Pyx_RefNannyDeclarations
9522 0 : PyObject *__pyx_t_1 = NULL;
9523 0 : PyObject *__pyx_t_2 = NULL;
9524 0 : PyObject *__pyx_t_3 = NULL;
9525 0 : PyObject *__pyx_t_4 = NULL;
9526 0 : PyObject *__pyx_t_5 = NULL;
9527 0 : PyObject *__pyx_t_6 = NULL;
9528 0 : PyObject *__pyx_t_7 = NULL;
9529 0 : unsigned int __pyx_t_8;
9530 0 : Py_ssize_t __pyx_t_9;
9531 0 : int __pyx_t_10;
9532 0 : int __pyx_t_11;
9533 0 : int __pyx_lineno = 0;
9534 0 : const char *__pyx_filename = NULL;
9535 0 : int __pyx_clineno = 0;
9536 0 : __Pyx_RefNannySetupContext("convert_item_to_object", 1);
9537 :
9538 : /* "View.MemoryView":492
9539 : * """Only used if instantiated manually by the user, or if Cython doesn't
9540 : * know how to convert the type"""
9541 : * import struct # <<<<<<<<<<<<<<
9542 : * cdef bytes bytesitem
9543 : *
9544 : */
9545 0 : __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 492, __pyx_L1_error)
9546 0 : __Pyx_GOTREF(__pyx_t_1);
9547 0 : __pyx_v_struct = __pyx_t_1;
9548 0 : __pyx_t_1 = 0;
9549 :
9550 : /* "View.MemoryView":495
9551 : * cdef bytes bytesitem
9552 : *
9553 : * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
9554 : * try:
9555 : * result = struct.unpack(self.view.format, bytesitem)
9556 : */
9557 0 : __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L1_error)
9558 0 : __Pyx_GOTREF(__pyx_t_1);
9559 0 : __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
9560 0 : __pyx_t_1 = 0;
9561 :
9562 : /* "View.MemoryView":496
9563 : *
9564 : * bytesitem = itemp[:self.view.itemsize]
9565 : * try: # <<<<<<<<<<<<<<
9566 : * result = struct.unpack(self.view.format, bytesitem)
9567 : * except struct.error:
9568 : */
9569 : {
9570 0 : __Pyx_PyThreadState_declare
9571 0 : __Pyx_PyThreadState_assign
9572 0 : __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
9573 0 : __Pyx_XGOTREF(__pyx_t_2);
9574 0 : __Pyx_XGOTREF(__pyx_t_3);
9575 0 : __Pyx_XGOTREF(__pyx_t_4);
9576 : /*try:*/ {
9577 :
9578 : /* "View.MemoryView":497
9579 : * bytesitem = itemp[:self.view.itemsize]
9580 : * try:
9581 : * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
9582 : * except struct.error:
9583 : * raise ValueError, "Unable to convert item to object"
9584 : */
9585 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 497, __pyx_L3_error)
9586 0 : __Pyx_GOTREF(__pyx_t_5);
9587 0 : __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 497, __pyx_L3_error)
9588 0 : __Pyx_GOTREF(__pyx_t_6);
9589 0 : __pyx_t_7 = NULL;
9590 0 : __pyx_t_8 = 0;
9591 : #if CYTHON_UNPACK_METHODS
9592 0 : if (likely(PyMethod_Check(__pyx_t_5))) {
9593 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
9594 0 : if (likely(__pyx_t_7)) {
9595 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
9596 0 : __Pyx_INCREF(__pyx_t_7);
9597 0 : __Pyx_INCREF(function);
9598 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
9599 : __pyx_t_8 = 1;
9600 : }
9601 : }
9602 : #endif
9603 : {
9604 0 : PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
9605 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
9606 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9607 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9608 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 497, __pyx_L3_error)
9609 0 : __Pyx_GOTREF(__pyx_t_1);
9610 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9611 : }
9612 0 : __pyx_v_result = __pyx_t_1;
9613 0 : __pyx_t_1 = 0;
9614 :
9615 : /* "View.MemoryView":496
9616 : *
9617 : * bytesitem = itemp[:self.view.itemsize]
9618 : * try: # <<<<<<<<<<<<<<
9619 : * result = struct.unpack(self.view.format, bytesitem)
9620 : * except struct.error:
9621 : */
9622 : }
9623 :
9624 : /* "View.MemoryView":501
9625 : * raise ValueError, "Unable to convert item to object"
9626 : * else:
9627 : * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
9628 : * return result[0]
9629 : * return result
9630 : */
9631 : /*else:*/ {
9632 0 : __pyx_t_9 = __Pyx_ssize_strlen(__pyx_v_self->view.format); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(1, 501, __pyx_L5_except_error)
9633 0 : __pyx_t_10 = (__pyx_t_9 == 1);
9634 0 : if (__pyx_t_10) {
9635 :
9636 : /* "View.MemoryView":502
9637 : * else:
9638 : * if len(self.view.format) == 1:
9639 : * return result[0] # <<<<<<<<<<<<<<
9640 : * return result
9641 : *
9642 : */
9643 0 : __Pyx_XDECREF(__pyx_r);
9644 0 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 502, __pyx_L5_except_error)
9645 0 : __Pyx_GOTREF(__pyx_t_1);
9646 0 : __pyx_r = __pyx_t_1;
9647 0 : __pyx_t_1 = 0;
9648 0 : goto __pyx_L6_except_return;
9649 :
9650 : /* "View.MemoryView":501
9651 : * raise ValueError, "Unable to convert item to object"
9652 : * else:
9653 : * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
9654 : * return result[0]
9655 : * return result
9656 : */
9657 : }
9658 :
9659 : /* "View.MemoryView":503
9660 : * if len(self.view.format) == 1:
9661 : * return result[0]
9662 : * return result # <<<<<<<<<<<<<<
9663 : *
9664 : * cdef assign_item_from_object(self, char *itemp, object value):
9665 : */
9666 0 : __Pyx_XDECREF(__pyx_r);
9667 0 : __Pyx_INCREF(__pyx_v_result);
9668 0 : __pyx_r = __pyx_v_result;
9669 0 : goto __pyx_L6_except_return;
9670 : }
9671 0 : __pyx_L3_error:;
9672 0 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9673 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9674 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9675 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9676 :
9677 : /* "View.MemoryView":498
9678 : * try:
9679 : * result = struct.unpack(self.view.format, bytesitem)
9680 : * except struct.error: # <<<<<<<<<<<<<<
9681 : * raise ValueError, "Unable to convert item to object"
9682 : * else:
9683 : */
9684 0 : __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6);
9685 0 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 498, __pyx_L5_except_error)
9686 0 : __Pyx_GOTREF(__pyx_t_7);
9687 0 : __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_7);
9688 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9689 0 : __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_6);
9690 0 : __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0;
9691 0 : if (__pyx_t_11) {
9692 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9693 0 : if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 498, __pyx_L5_except_error)
9694 0 : __Pyx_XGOTREF(__pyx_t_6);
9695 0 : __Pyx_XGOTREF(__pyx_t_5);
9696 0 : __Pyx_XGOTREF(__pyx_t_1);
9697 :
9698 : /* "View.MemoryView":499
9699 : * result = struct.unpack(self.view.format, bytesitem)
9700 : * except struct.error:
9701 : * raise ValueError, "Unable to convert item to object" # <<<<<<<<<<<<<<
9702 : * else:
9703 : * if len(self.view.format) == 1:
9704 : */
9705 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Unable_to_convert_item_to_object, 0, 0);
9706 0 : __PYX_ERR(1, 499, __pyx_L5_except_error)
9707 : }
9708 0 : goto __pyx_L5_except_error;
9709 :
9710 : /* "View.MemoryView":496
9711 : *
9712 : * bytesitem = itemp[:self.view.itemsize]
9713 : * try: # <<<<<<<<<<<<<<
9714 : * result = struct.unpack(self.view.format, bytesitem)
9715 : * except struct.error:
9716 : */
9717 0 : __pyx_L5_except_error:;
9718 0 : __Pyx_XGIVEREF(__pyx_t_2);
9719 0 : __Pyx_XGIVEREF(__pyx_t_3);
9720 0 : __Pyx_XGIVEREF(__pyx_t_4);
9721 0 : __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9722 0 : goto __pyx_L1_error;
9723 0 : __pyx_L6_except_return:;
9724 0 : __Pyx_XGIVEREF(__pyx_t_2);
9725 0 : __Pyx_XGIVEREF(__pyx_t_3);
9726 0 : __Pyx_XGIVEREF(__pyx_t_4);
9727 0 : __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9728 0 : goto __pyx_L0;
9729 : }
9730 :
9731 : /* "View.MemoryView":489
9732 : * self.assign_item_from_object(itemp, value)
9733 : *
9734 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
9735 : * """Only used if instantiated manually by the user, or if Cython doesn't
9736 : * know how to convert the type"""
9737 : */
9738 :
9739 : /* function exit code */
9740 0 : __pyx_L1_error:;
9741 0 : __Pyx_XDECREF(__pyx_t_1);
9742 0 : __Pyx_XDECREF(__pyx_t_5);
9743 0 : __Pyx_XDECREF(__pyx_t_6);
9744 0 : __Pyx_XDECREF(__pyx_t_7);
9745 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9746 0 : __pyx_r = 0;
9747 0 : __pyx_L0:;
9748 0 : __Pyx_XDECREF(__pyx_v_struct);
9749 0 : __Pyx_XDECREF(__pyx_v_bytesitem);
9750 0 : __Pyx_XDECREF(__pyx_v_result);
9751 0 : __Pyx_XGIVEREF(__pyx_r);
9752 0 : __Pyx_RefNannyFinishContext();
9753 0 : return __pyx_r;
9754 : }
9755 :
9756 : /* "View.MemoryView":505
9757 : * return result
9758 : *
9759 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
9760 : * """Only used if instantiated manually by the user, or if Cython doesn't
9761 : * know how to convert the type"""
9762 : */
9763 :
9764 0 : static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
9765 0 : PyObject *__pyx_v_struct = NULL;
9766 0 : char __pyx_v_c;
9767 0 : PyObject *__pyx_v_bytesvalue = 0;
9768 0 : Py_ssize_t __pyx_v_i;
9769 0 : PyObject *__pyx_r = NULL;
9770 : __Pyx_RefNannyDeclarations
9771 0 : PyObject *__pyx_t_1 = NULL;
9772 0 : int __pyx_t_2;
9773 0 : PyObject *__pyx_t_3 = NULL;
9774 0 : PyObject *__pyx_t_4 = NULL;
9775 0 : PyObject *__pyx_t_5 = NULL;
9776 0 : unsigned int __pyx_t_6;
9777 0 : Py_ssize_t __pyx_t_7;
9778 0 : PyObject *__pyx_t_8 = NULL;
9779 0 : char *__pyx_t_9;
9780 0 : char *__pyx_t_10;
9781 0 : char *__pyx_t_11;
9782 0 : char *__pyx_t_12;
9783 0 : int __pyx_lineno = 0;
9784 0 : const char *__pyx_filename = NULL;
9785 0 : int __pyx_clineno = 0;
9786 0 : __Pyx_RefNannySetupContext("assign_item_from_object", 1);
9787 :
9788 : /* "View.MemoryView":508
9789 : * """Only used if instantiated manually by the user, or if Cython doesn't
9790 : * know how to convert the type"""
9791 : * import struct # <<<<<<<<<<<<<<
9792 : * cdef char c
9793 : * cdef bytes bytesvalue
9794 : */
9795 0 : __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 508, __pyx_L1_error)
9796 0 : __Pyx_GOTREF(__pyx_t_1);
9797 0 : __pyx_v_struct = __pyx_t_1;
9798 0 : __pyx_t_1 = 0;
9799 :
9800 : /* "View.MemoryView":513
9801 : * cdef Py_ssize_t i
9802 : *
9803 : * if isinstance(value, tuple): # <<<<<<<<<<<<<<
9804 : * bytesvalue = struct.pack(self.view.format, *value)
9805 : * else:
9806 : */
9807 0 : __pyx_t_2 = PyTuple_Check(__pyx_v_value);
9808 0 : if (__pyx_t_2) {
9809 :
9810 : /* "View.MemoryView":514
9811 : *
9812 : * if isinstance(value, tuple):
9813 : * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
9814 : * else:
9815 : * bytesvalue = struct.pack(self.view.format, value)
9816 : */
9817 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 514, __pyx_L1_error)
9818 0 : __Pyx_GOTREF(__pyx_t_1);
9819 0 : __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
9820 0 : __Pyx_GOTREF(__pyx_t_3);
9821 0 : __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
9822 0 : __Pyx_GOTREF(__pyx_t_4);
9823 0 : __Pyx_GIVEREF(__pyx_t_3);
9824 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error);
9825 0 : __pyx_t_3 = 0;
9826 0 : __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
9827 0 : __Pyx_GOTREF(__pyx_t_3);
9828 0 : __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 514, __pyx_L1_error)
9829 0 : __Pyx_GOTREF(__pyx_t_5);
9830 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9831 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9832 0 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
9833 0 : __Pyx_GOTREF(__pyx_t_3);
9834 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9835 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9836 0 : if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(1, 514, __pyx_L1_error)
9837 0 : __pyx_v_bytesvalue = ((PyObject*)__pyx_t_3);
9838 0 : __pyx_t_3 = 0;
9839 :
9840 : /* "View.MemoryView":513
9841 : * cdef Py_ssize_t i
9842 : *
9843 : * if isinstance(value, tuple): # <<<<<<<<<<<<<<
9844 : * bytesvalue = struct.pack(self.view.format, *value)
9845 : * else:
9846 : */
9847 0 : goto __pyx_L3;
9848 : }
9849 :
9850 : /* "View.MemoryView":516
9851 : * bytesvalue = struct.pack(self.view.format, *value)
9852 : * else:
9853 : * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
9854 : *
9855 : * for i, c in enumerate(bytesvalue):
9856 : */
9857 : /*else*/ {
9858 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 516, __pyx_L1_error)
9859 0 : __Pyx_GOTREF(__pyx_t_5);
9860 0 : __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 516, __pyx_L1_error)
9861 0 : __Pyx_GOTREF(__pyx_t_1);
9862 0 : __pyx_t_4 = NULL;
9863 0 : __pyx_t_6 = 0;
9864 : #if CYTHON_UNPACK_METHODS
9865 0 : if (likely(PyMethod_Check(__pyx_t_5))) {
9866 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
9867 0 : if (likely(__pyx_t_4)) {
9868 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
9869 0 : __Pyx_INCREF(__pyx_t_4);
9870 0 : __Pyx_INCREF(function);
9871 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
9872 : __pyx_t_6 = 1;
9873 : }
9874 : }
9875 : #endif
9876 : {
9877 0 : PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_1, __pyx_v_value};
9878 0 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
9879 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9880 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9881 0 : if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 516, __pyx_L1_error)
9882 0 : __Pyx_GOTREF(__pyx_t_3);
9883 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9884 : }
9885 0 : if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(1, 516, __pyx_L1_error)
9886 : __pyx_v_bytesvalue = ((PyObject*)__pyx_t_3);
9887 : __pyx_t_3 = 0;
9888 : }
9889 0 : __pyx_L3:;
9890 :
9891 : /* "View.MemoryView":518
9892 : * bytesvalue = struct.pack(self.view.format, value)
9893 : *
9894 : * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
9895 : * itemp[i] = c
9896 : *
9897 : */
9898 0 : __pyx_t_7 = 0;
9899 0 : if (unlikely(__pyx_v_bytesvalue == Py_None)) {
9900 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
9901 0 : __PYX_ERR(1, 518, __pyx_L1_error)
9902 : }
9903 0 : __Pyx_INCREF(__pyx_v_bytesvalue);
9904 0 : __pyx_t_8 = __pyx_v_bytesvalue;
9905 0 : __pyx_t_10 = PyBytes_AS_STRING(__pyx_t_8);
9906 0 : __pyx_t_11 = (__pyx_t_10 + PyBytes_GET_SIZE(__pyx_t_8));
9907 0 : for (__pyx_t_12 = __pyx_t_10; __pyx_t_12 < __pyx_t_11; __pyx_t_12++) {
9908 0 : __pyx_t_9 = __pyx_t_12;
9909 0 : __pyx_v_c = (__pyx_t_9[0]);
9910 :
9911 : /* "View.MemoryView":519
9912 : *
9913 : * for i, c in enumerate(bytesvalue):
9914 : * itemp[i] = c # <<<<<<<<<<<<<<
9915 : *
9916 : * @cname('getbuffer')
9917 : */
9918 0 : __pyx_v_i = __pyx_t_7;
9919 :
9920 : /* "View.MemoryView":518
9921 : * bytesvalue = struct.pack(self.view.format, value)
9922 : *
9923 : * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
9924 : * itemp[i] = c
9925 : *
9926 : */
9927 0 : __pyx_t_7 = (__pyx_t_7 + 1);
9928 :
9929 : /* "View.MemoryView":519
9930 : *
9931 : * for i, c in enumerate(bytesvalue):
9932 : * itemp[i] = c # <<<<<<<<<<<<<<
9933 : *
9934 : * @cname('getbuffer')
9935 : */
9936 0 : (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
9937 : }
9938 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9939 :
9940 : /* "View.MemoryView":505
9941 : * return result
9942 : *
9943 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
9944 : * """Only used if instantiated manually by the user, or if Cython doesn't
9945 : * know how to convert the type"""
9946 : */
9947 :
9948 : /* function exit code */
9949 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9950 0 : goto __pyx_L0;
9951 0 : __pyx_L1_error:;
9952 0 : __Pyx_XDECREF(__pyx_t_1);
9953 0 : __Pyx_XDECREF(__pyx_t_3);
9954 0 : __Pyx_XDECREF(__pyx_t_4);
9955 0 : __Pyx_XDECREF(__pyx_t_5);
9956 0 : __Pyx_XDECREF(__pyx_t_8);
9957 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9958 0 : __pyx_r = 0;
9959 0 : __pyx_L0:;
9960 0 : __Pyx_XDECREF(__pyx_v_struct);
9961 0 : __Pyx_XDECREF(__pyx_v_bytesvalue);
9962 0 : __Pyx_XGIVEREF(__pyx_r);
9963 0 : __Pyx_RefNannyFinishContext();
9964 0 : return __pyx_r;
9965 : }
9966 :
9967 : /* "View.MemoryView":521
9968 : * itemp[i] = c
9969 : *
9970 : * @cname('getbuffer') # <<<<<<<<<<<<<<
9971 : * def __getbuffer__(self, Py_buffer *info, int flags):
9972 : * if flags & PyBUF_WRITABLE and self.view.readonly:
9973 : */
9974 :
9975 : /* Python wrapper */
9976 : CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
9977 0 : CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9978 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
9979 0 : int __pyx_r;
9980 : __Pyx_RefNannyDeclarations
9981 0 : __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
9982 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
9983 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
9984 :
9985 : /* function exit code */
9986 0 : __Pyx_RefNannyFinishContext();
9987 0 : return __pyx_r;
9988 : }
9989 :
9990 0 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9991 0 : int __pyx_r;
9992 : __Pyx_RefNannyDeclarations
9993 0 : int __pyx_t_1;
9994 0 : int __pyx_t_2;
9995 0 : Py_ssize_t *__pyx_t_3;
9996 0 : char *__pyx_t_4;
9997 0 : void *__pyx_t_5;
9998 0 : int __pyx_t_6;
9999 0 : Py_ssize_t __pyx_t_7;
10000 0 : int __pyx_lineno = 0;
10001 0 : const char *__pyx_filename = NULL;
10002 0 : int __pyx_clineno = 0;
10003 0 : if (unlikely(__pyx_v_info == NULL)) {
10004 0 : PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
10005 0 : return -1;
10006 : }
10007 0 : __Pyx_RefNannySetupContext("__getbuffer__", 0);
10008 0 : __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
10009 0 : __Pyx_GIVEREF(__pyx_v_info->obj);
10010 :
10011 : /* "View.MemoryView":523
10012 : * @cname('getbuffer')
10013 : * def __getbuffer__(self, Py_buffer *info, int flags):
10014 : * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
10015 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
10016 : *
10017 : */
10018 0 : __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
10019 0 : if (__pyx_t_2) {
10020 0 : } else {
10021 0 : __pyx_t_1 = __pyx_t_2;
10022 0 : goto __pyx_L4_bool_binop_done;
10023 : }
10024 0 : __pyx_t_1 = __pyx_v_self->view.readonly;
10025 0 : __pyx_L4_bool_binop_done:;
10026 0 : if (unlikely(__pyx_t_1)) {
10027 :
10028 : /* "View.MemoryView":524
10029 : * def __getbuffer__(self, Py_buffer *info, int flags):
10030 : * if flags & PyBUF_WRITABLE and self.view.readonly:
10031 : * raise ValueError, "Cannot create writable memory view from read-only memoryview" # <<<<<<<<<<<<<<
10032 : *
10033 : * if flags & PyBUF_ND:
10034 : */
10035 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Cannot_create_writable_memory_vi, 0, 0);
10036 0 : __PYX_ERR(1, 524, __pyx_L1_error)
10037 :
10038 : /* "View.MemoryView":523
10039 : * @cname('getbuffer')
10040 : * def __getbuffer__(self, Py_buffer *info, int flags):
10041 : * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
10042 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
10043 : *
10044 : */
10045 : }
10046 :
10047 : /* "View.MemoryView":526
10048 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
10049 : *
10050 : * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
10051 : * info.shape = self.view.shape
10052 : * else:
10053 : */
10054 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
10055 0 : if (__pyx_t_1) {
10056 :
10057 : /* "View.MemoryView":527
10058 : *
10059 : * if flags & PyBUF_ND:
10060 : * info.shape = self.view.shape # <<<<<<<<<<<<<<
10061 : * else:
10062 : * info.shape = NULL
10063 : */
10064 0 : __pyx_t_3 = __pyx_v_self->view.shape;
10065 0 : __pyx_v_info->shape = __pyx_t_3;
10066 :
10067 : /* "View.MemoryView":526
10068 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
10069 : *
10070 : * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
10071 : * info.shape = self.view.shape
10072 : * else:
10073 : */
10074 0 : goto __pyx_L6;
10075 : }
10076 :
10077 : /* "View.MemoryView":529
10078 : * info.shape = self.view.shape
10079 : * else:
10080 : * info.shape = NULL # <<<<<<<<<<<<<<
10081 : *
10082 : * if flags & PyBUF_STRIDES:
10083 : */
10084 : /*else*/ {
10085 0 : __pyx_v_info->shape = NULL;
10086 : }
10087 0 : __pyx_L6:;
10088 :
10089 : /* "View.MemoryView":531
10090 : * info.shape = NULL
10091 : *
10092 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
10093 : * info.strides = self.view.strides
10094 : * else:
10095 : */
10096 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
10097 0 : if (__pyx_t_1) {
10098 :
10099 : /* "View.MemoryView":532
10100 : *
10101 : * if flags & PyBUF_STRIDES:
10102 : * info.strides = self.view.strides # <<<<<<<<<<<<<<
10103 : * else:
10104 : * info.strides = NULL
10105 : */
10106 0 : __pyx_t_3 = __pyx_v_self->view.strides;
10107 0 : __pyx_v_info->strides = __pyx_t_3;
10108 :
10109 : /* "View.MemoryView":531
10110 : * info.shape = NULL
10111 : *
10112 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
10113 : * info.strides = self.view.strides
10114 : * else:
10115 : */
10116 0 : goto __pyx_L7;
10117 : }
10118 :
10119 : /* "View.MemoryView":534
10120 : * info.strides = self.view.strides
10121 : * else:
10122 : * info.strides = NULL # <<<<<<<<<<<<<<
10123 : *
10124 : * if flags & PyBUF_INDIRECT:
10125 : */
10126 : /*else*/ {
10127 0 : __pyx_v_info->strides = NULL;
10128 : }
10129 0 : __pyx_L7:;
10130 :
10131 : /* "View.MemoryView":536
10132 : * info.strides = NULL
10133 : *
10134 : * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
10135 : * info.suboffsets = self.view.suboffsets
10136 : * else:
10137 : */
10138 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
10139 0 : if (__pyx_t_1) {
10140 :
10141 : /* "View.MemoryView":537
10142 : *
10143 : * if flags & PyBUF_INDIRECT:
10144 : * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
10145 : * else:
10146 : * info.suboffsets = NULL
10147 : */
10148 0 : __pyx_t_3 = __pyx_v_self->view.suboffsets;
10149 0 : __pyx_v_info->suboffsets = __pyx_t_3;
10150 :
10151 : /* "View.MemoryView":536
10152 : * info.strides = NULL
10153 : *
10154 : * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
10155 : * info.suboffsets = self.view.suboffsets
10156 : * else:
10157 : */
10158 0 : goto __pyx_L8;
10159 : }
10160 :
10161 : /* "View.MemoryView":539
10162 : * info.suboffsets = self.view.suboffsets
10163 : * else:
10164 : * info.suboffsets = NULL # <<<<<<<<<<<<<<
10165 : *
10166 : * if flags & PyBUF_FORMAT:
10167 : */
10168 : /*else*/ {
10169 0 : __pyx_v_info->suboffsets = NULL;
10170 : }
10171 0 : __pyx_L8:;
10172 :
10173 : /* "View.MemoryView":541
10174 : * info.suboffsets = NULL
10175 : *
10176 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10177 : * info.format = self.view.format
10178 : * else:
10179 : */
10180 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10181 0 : if (__pyx_t_1) {
10182 :
10183 : /* "View.MemoryView":542
10184 : *
10185 : * if flags & PyBUF_FORMAT:
10186 : * info.format = self.view.format # <<<<<<<<<<<<<<
10187 : * else:
10188 : * info.format = NULL
10189 : */
10190 0 : __pyx_t_4 = __pyx_v_self->view.format;
10191 0 : __pyx_v_info->format = __pyx_t_4;
10192 :
10193 : /* "View.MemoryView":541
10194 : * info.suboffsets = NULL
10195 : *
10196 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10197 : * info.format = self.view.format
10198 : * else:
10199 : */
10200 0 : goto __pyx_L9;
10201 : }
10202 :
10203 : /* "View.MemoryView":544
10204 : * info.format = self.view.format
10205 : * else:
10206 : * info.format = NULL # <<<<<<<<<<<<<<
10207 : *
10208 : * info.buf = self.view.buf
10209 : */
10210 : /*else*/ {
10211 0 : __pyx_v_info->format = NULL;
10212 : }
10213 0 : __pyx_L9:;
10214 :
10215 : /* "View.MemoryView":546
10216 : * info.format = NULL
10217 : *
10218 : * info.buf = self.view.buf # <<<<<<<<<<<<<<
10219 : * info.ndim = self.view.ndim
10220 : * info.itemsize = self.view.itemsize
10221 : */
10222 0 : __pyx_t_5 = __pyx_v_self->view.buf;
10223 0 : __pyx_v_info->buf = __pyx_t_5;
10224 :
10225 : /* "View.MemoryView":547
10226 : *
10227 : * info.buf = self.view.buf
10228 : * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
10229 : * info.itemsize = self.view.itemsize
10230 : * info.len = self.view.len
10231 : */
10232 0 : __pyx_t_6 = __pyx_v_self->view.ndim;
10233 0 : __pyx_v_info->ndim = __pyx_t_6;
10234 :
10235 : /* "View.MemoryView":548
10236 : * info.buf = self.view.buf
10237 : * info.ndim = self.view.ndim
10238 : * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
10239 : * info.len = self.view.len
10240 : * info.readonly = self.view.readonly
10241 : */
10242 0 : __pyx_t_7 = __pyx_v_self->view.itemsize;
10243 0 : __pyx_v_info->itemsize = __pyx_t_7;
10244 :
10245 : /* "View.MemoryView":549
10246 : * info.ndim = self.view.ndim
10247 : * info.itemsize = self.view.itemsize
10248 : * info.len = self.view.len # <<<<<<<<<<<<<<
10249 : * info.readonly = self.view.readonly
10250 : * info.obj = self
10251 : */
10252 0 : __pyx_t_7 = __pyx_v_self->view.len;
10253 0 : __pyx_v_info->len = __pyx_t_7;
10254 :
10255 : /* "View.MemoryView":550
10256 : * info.itemsize = self.view.itemsize
10257 : * info.len = self.view.len
10258 : * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
10259 : * info.obj = self
10260 : *
10261 : */
10262 0 : __pyx_t_1 = __pyx_v_self->view.readonly;
10263 0 : __pyx_v_info->readonly = __pyx_t_1;
10264 :
10265 : /* "View.MemoryView":551
10266 : * info.len = self.view.len
10267 : * info.readonly = self.view.readonly
10268 : * info.obj = self # <<<<<<<<<<<<<<
10269 : *
10270 : *
10271 : */
10272 0 : __Pyx_INCREF((PyObject *)__pyx_v_self);
10273 0 : __Pyx_GIVEREF((PyObject *)__pyx_v_self);
10274 0 : __Pyx_GOTREF(__pyx_v_info->obj);
10275 0 : __Pyx_DECREF(__pyx_v_info->obj);
10276 0 : __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
10277 :
10278 : /* "View.MemoryView":521
10279 : * itemp[i] = c
10280 : *
10281 : * @cname('getbuffer') # <<<<<<<<<<<<<<
10282 : * def __getbuffer__(self, Py_buffer *info, int flags):
10283 : * if flags & PyBUF_WRITABLE and self.view.readonly:
10284 : */
10285 :
10286 : /* function exit code */
10287 0 : __pyx_r = 0;
10288 0 : goto __pyx_L0;
10289 0 : __pyx_L1_error:;
10290 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10291 0 : __pyx_r = -1;
10292 0 : if (__pyx_v_info->obj != NULL) {
10293 0 : __Pyx_GOTREF(__pyx_v_info->obj);
10294 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10295 : }
10296 0 : goto __pyx_L2;
10297 0 : __pyx_L0:;
10298 0 : if (__pyx_v_info->obj == Py_None) {
10299 0 : __Pyx_GOTREF(__pyx_v_info->obj);
10300 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10301 : }
10302 0 : __pyx_L2:;
10303 : __Pyx_RefNannyFinishContext();
10304 : return __pyx_r;
10305 : }
10306 :
10307 : /* "View.MemoryView":554
10308 : *
10309 : *
10310 : * @property # <<<<<<<<<<<<<<
10311 : * def T(self):
10312 : * cdef _memoryviewslice result = memoryview_copy(self)
10313 : */
10314 :
10315 : /* Python wrapper */
10316 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
10317 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
10318 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10319 0 : PyObject *__pyx_r = 0;
10320 : __Pyx_RefNannyDeclarations
10321 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10322 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10323 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10324 :
10325 : /* function exit code */
10326 0 : __Pyx_RefNannyFinishContext();
10327 0 : return __pyx_r;
10328 : }
10329 :
10330 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10331 0 : struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
10332 0 : PyObject *__pyx_r = NULL;
10333 : __Pyx_RefNannyDeclarations
10334 0 : PyObject *__pyx_t_1 = NULL;
10335 0 : int __pyx_t_2;
10336 0 : int __pyx_lineno = 0;
10337 0 : const char *__pyx_filename = NULL;
10338 0 : int __pyx_clineno = 0;
10339 0 : __Pyx_RefNannySetupContext("__get__", 1);
10340 :
10341 : /* "View.MemoryView":556
10342 : * @property
10343 : * def T(self):
10344 : * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
10345 : * transpose_memslice(&result.from_slice)
10346 : * return result
10347 : */
10348 0 : __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
10349 0 : __Pyx_GOTREF(__pyx_t_1);
10350 0 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 556, __pyx_L1_error)
10351 0 : __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
10352 0 : __pyx_t_1 = 0;
10353 :
10354 : /* "View.MemoryView":557
10355 : * def T(self):
10356 : * cdef _memoryviewslice result = memoryview_copy(self)
10357 : * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
10358 : * return result
10359 : *
10360 : */
10361 0 : __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 557, __pyx_L1_error)
10362 :
10363 : /* "View.MemoryView":558
10364 : * cdef _memoryviewslice result = memoryview_copy(self)
10365 : * transpose_memslice(&result.from_slice)
10366 : * return result # <<<<<<<<<<<<<<
10367 : *
10368 : * @property
10369 : */
10370 0 : __Pyx_XDECREF(__pyx_r);
10371 0 : __Pyx_INCREF((PyObject *)__pyx_v_result);
10372 0 : __pyx_r = ((PyObject *)__pyx_v_result);
10373 0 : goto __pyx_L0;
10374 :
10375 : /* "View.MemoryView":554
10376 : *
10377 : *
10378 : * @property # <<<<<<<<<<<<<<
10379 : * def T(self):
10380 : * cdef _memoryviewslice result = memoryview_copy(self)
10381 : */
10382 :
10383 : /* function exit code */
10384 0 : __pyx_L1_error:;
10385 0 : __Pyx_XDECREF(__pyx_t_1);
10386 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10387 0 : __pyx_r = NULL;
10388 0 : __pyx_L0:;
10389 0 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
10390 0 : __Pyx_XGIVEREF(__pyx_r);
10391 0 : __Pyx_RefNannyFinishContext();
10392 0 : return __pyx_r;
10393 : }
10394 :
10395 : /* "View.MemoryView":560
10396 : * return result
10397 : *
10398 : * @property # <<<<<<<<<<<<<<
10399 : * def base(self):
10400 : * return self._get_base()
10401 : */
10402 :
10403 : /* Python wrapper */
10404 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
10405 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
10406 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10407 0 : PyObject *__pyx_r = 0;
10408 : __Pyx_RefNannyDeclarations
10409 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10410 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10411 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10412 :
10413 : /* function exit code */
10414 0 : __Pyx_RefNannyFinishContext();
10415 0 : return __pyx_r;
10416 : }
10417 :
10418 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10419 0 : PyObject *__pyx_r = NULL;
10420 : __Pyx_RefNannyDeclarations
10421 0 : PyObject *__pyx_t_1 = NULL;
10422 0 : int __pyx_lineno = 0;
10423 0 : const char *__pyx_filename = NULL;
10424 0 : int __pyx_clineno = 0;
10425 0 : __Pyx_RefNannySetupContext("__get__", 1);
10426 :
10427 : /* "View.MemoryView":562
10428 : * @property
10429 : * def base(self):
10430 : * return self._get_base() # <<<<<<<<<<<<<<
10431 : *
10432 : * cdef _get_base(self):
10433 : */
10434 0 : __Pyx_XDECREF(__pyx_r);
10435 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->_get_base(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 562, __pyx_L1_error)
10436 0 : __Pyx_GOTREF(__pyx_t_1);
10437 0 : __pyx_r = __pyx_t_1;
10438 0 : __pyx_t_1 = 0;
10439 0 : goto __pyx_L0;
10440 :
10441 : /* "View.MemoryView":560
10442 : * return result
10443 : *
10444 : * @property # <<<<<<<<<<<<<<
10445 : * def base(self):
10446 : * return self._get_base()
10447 : */
10448 :
10449 : /* function exit code */
10450 0 : __pyx_L1_error:;
10451 0 : __Pyx_XDECREF(__pyx_t_1);
10452 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10453 0 : __pyx_r = NULL;
10454 0 : __pyx_L0:;
10455 0 : __Pyx_XGIVEREF(__pyx_r);
10456 0 : __Pyx_RefNannyFinishContext();
10457 0 : return __pyx_r;
10458 : }
10459 :
10460 : /* "View.MemoryView":564
10461 : * return self._get_base()
10462 : *
10463 : * cdef _get_base(self): # <<<<<<<<<<<<<<
10464 : * return self.obj
10465 : *
10466 : */
10467 :
10468 0 : static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self) {
10469 0 : PyObject *__pyx_r = NULL;
10470 : __Pyx_RefNannyDeclarations
10471 0 : __Pyx_RefNannySetupContext("_get_base", 1);
10472 :
10473 : /* "View.MemoryView":565
10474 : *
10475 : * cdef _get_base(self):
10476 : * return self.obj # <<<<<<<<<<<<<<
10477 : *
10478 : * @property
10479 : */
10480 0 : __Pyx_XDECREF(__pyx_r);
10481 0 : __Pyx_INCREF(__pyx_v_self->obj);
10482 0 : __pyx_r = __pyx_v_self->obj;
10483 0 : goto __pyx_L0;
10484 :
10485 : /* "View.MemoryView":564
10486 : * return self._get_base()
10487 : *
10488 : * cdef _get_base(self): # <<<<<<<<<<<<<<
10489 : * return self.obj
10490 : *
10491 : */
10492 :
10493 : /* function exit code */
10494 0 : __pyx_L0:;
10495 0 : __Pyx_XGIVEREF(__pyx_r);
10496 0 : __Pyx_RefNannyFinishContext();
10497 0 : return __pyx_r;
10498 : }
10499 :
10500 : /* "View.MemoryView":567
10501 : * return self.obj
10502 : *
10503 : * @property # <<<<<<<<<<<<<<
10504 : * def shape(self):
10505 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
10506 : */
10507 :
10508 : /* Python wrapper */
10509 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
10510 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
10511 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10512 0 : PyObject *__pyx_r = 0;
10513 : __Pyx_RefNannyDeclarations
10514 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10515 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10516 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10517 :
10518 : /* function exit code */
10519 0 : __Pyx_RefNannyFinishContext();
10520 0 : return __pyx_r;
10521 : }
10522 :
10523 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10524 0 : Py_ssize_t __pyx_7genexpr__pyx_v_length;
10525 0 : PyObject *__pyx_r = NULL;
10526 : __Pyx_RefNannyDeclarations
10527 0 : PyObject *__pyx_t_1 = NULL;
10528 0 : Py_ssize_t *__pyx_t_2;
10529 0 : Py_ssize_t *__pyx_t_3;
10530 0 : Py_ssize_t *__pyx_t_4;
10531 0 : PyObject *__pyx_t_5 = NULL;
10532 0 : int __pyx_lineno = 0;
10533 0 : const char *__pyx_filename = NULL;
10534 0 : int __pyx_clineno = 0;
10535 0 : __Pyx_RefNannySetupContext("__get__", 1);
10536 :
10537 : /* "View.MemoryView":569
10538 : * @property
10539 : * def shape(self):
10540 : * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
10541 : *
10542 : * @property
10543 : */
10544 0 : __Pyx_XDECREF(__pyx_r);
10545 : { /* enter inner scope */
10546 0 : __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __pyx_L1_error)
10547 0 : __Pyx_GOTREF(__pyx_t_1);
10548 0 : __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
10549 0 : for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
10550 0 : __pyx_t_2 = __pyx_t_4;
10551 0 : __pyx_7genexpr__pyx_v_length = (__pyx_t_2[0]);
10552 0 : __pyx_t_5 = PyInt_FromSsize_t(__pyx_7genexpr__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 569, __pyx_L1_error)
10553 0 : __Pyx_GOTREF(__pyx_t_5);
10554 0 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 569, __pyx_L1_error)
10555 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10556 : }
10557 : } /* exit inner scope */
10558 0 : __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 569, __pyx_L1_error)
10559 0 : __Pyx_GOTREF(__pyx_t_5);
10560 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10561 0 : __pyx_r = __pyx_t_5;
10562 0 : __pyx_t_5 = 0;
10563 0 : goto __pyx_L0;
10564 :
10565 : /* "View.MemoryView":567
10566 : * return self.obj
10567 : *
10568 : * @property # <<<<<<<<<<<<<<
10569 : * def shape(self):
10570 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
10571 : */
10572 :
10573 : /* function exit code */
10574 0 : __pyx_L1_error:;
10575 0 : __Pyx_XDECREF(__pyx_t_1);
10576 0 : __Pyx_XDECREF(__pyx_t_5);
10577 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10578 0 : __pyx_r = NULL;
10579 0 : __pyx_L0:;
10580 0 : __Pyx_XGIVEREF(__pyx_r);
10581 0 : __Pyx_RefNannyFinishContext();
10582 0 : return __pyx_r;
10583 : }
10584 :
10585 : /* "View.MemoryView":571
10586 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
10587 : *
10588 : * @property # <<<<<<<<<<<<<<
10589 : * def strides(self):
10590 : * if self.view.strides == NULL:
10591 : */
10592 :
10593 : /* Python wrapper */
10594 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
10595 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
10596 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10597 0 : PyObject *__pyx_r = 0;
10598 : __Pyx_RefNannyDeclarations
10599 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10600 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10601 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10602 :
10603 : /* function exit code */
10604 0 : __Pyx_RefNannyFinishContext();
10605 0 : return __pyx_r;
10606 : }
10607 :
10608 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10609 0 : Py_ssize_t __pyx_8genexpr1__pyx_v_stride;
10610 0 : PyObject *__pyx_r = NULL;
10611 : __Pyx_RefNannyDeclarations
10612 0 : int __pyx_t_1;
10613 0 : PyObject *__pyx_t_2 = NULL;
10614 0 : Py_ssize_t *__pyx_t_3;
10615 0 : Py_ssize_t *__pyx_t_4;
10616 0 : Py_ssize_t *__pyx_t_5;
10617 0 : PyObject *__pyx_t_6 = NULL;
10618 0 : int __pyx_lineno = 0;
10619 0 : const char *__pyx_filename = NULL;
10620 0 : int __pyx_clineno = 0;
10621 0 : __Pyx_RefNannySetupContext("__get__", 1);
10622 :
10623 : /* "View.MemoryView":573
10624 : * @property
10625 : * def strides(self):
10626 : * if self.view.strides == NULL: # <<<<<<<<<<<<<<
10627 : *
10628 : * raise ValueError, "Buffer view does not expose strides"
10629 : */
10630 0 : __pyx_t_1 = (__pyx_v_self->view.strides == NULL);
10631 0 : if (unlikely(__pyx_t_1)) {
10632 :
10633 : /* "View.MemoryView":575
10634 : * if self.view.strides == NULL:
10635 : *
10636 : * raise ValueError, "Buffer view does not expose strides" # <<<<<<<<<<<<<<
10637 : *
10638 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
10639 : */
10640 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Buffer_view_does_not_expose_stri, 0, 0);
10641 0 : __PYX_ERR(1, 575, __pyx_L1_error)
10642 :
10643 : /* "View.MemoryView":573
10644 : * @property
10645 : * def strides(self):
10646 : * if self.view.strides == NULL: # <<<<<<<<<<<<<<
10647 : *
10648 : * raise ValueError, "Buffer view does not expose strides"
10649 : */
10650 : }
10651 :
10652 : /* "View.MemoryView":577
10653 : * raise ValueError, "Buffer view does not expose strides"
10654 : *
10655 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
10656 : *
10657 : * @property
10658 : */
10659 0 : __Pyx_XDECREF(__pyx_r);
10660 : { /* enter inner scope */
10661 0 : __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
10662 0 : __Pyx_GOTREF(__pyx_t_2);
10663 0 : __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
10664 0 : for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
10665 0 : __pyx_t_3 = __pyx_t_5;
10666 0 : __pyx_8genexpr1__pyx_v_stride = (__pyx_t_3[0]);
10667 0 : __pyx_t_6 = PyInt_FromSsize_t(__pyx_8genexpr1__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 577, __pyx_L1_error)
10668 0 : __Pyx_GOTREF(__pyx_t_6);
10669 0 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 577, __pyx_L1_error)
10670 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10671 : }
10672 : } /* exit inner scope */
10673 0 : __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 577, __pyx_L1_error)
10674 0 : __Pyx_GOTREF(__pyx_t_6);
10675 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10676 0 : __pyx_r = __pyx_t_6;
10677 0 : __pyx_t_6 = 0;
10678 0 : goto __pyx_L0;
10679 :
10680 : /* "View.MemoryView":571
10681 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
10682 : *
10683 : * @property # <<<<<<<<<<<<<<
10684 : * def strides(self):
10685 : * if self.view.strides == NULL:
10686 : */
10687 :
10688 : /* function exit code */
10689 0 : __pyx_L1_error:;
10690 0 : __Pyx_XDECREF(__pyx_t_2);
10691 0 : __Pyx_XDECREF(__pyx_t_6);
10692 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10693 0 : __pyx_r = NULL;
10694 0 : __pyx_L0:;
10695 0 : __Pyx_XGIVEREF(__pyx_r);
10696 0 : __Pyx_RefNannyFinishContext();
10697 0 : return __pyx_r;
10698 : }
10699 :
10700 : /* "View.MemoryView":579
10701 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
10702 : *
10703 : * @property # <<<<<<<<<<<<<<
10704 : * def suboffsets(self):
10705 : * if self.view.suboffsets == NULL:
10706 : */
10707 :
10708 : /* Python wrapper */
10709 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
10710 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
10711 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10712 0 : PyObject *__pyx_r = 0;
10713 : __Pyx_RefNannyDeclarations
10714 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10715 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10716 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10717 :
10718 : /* function exit code */
10719 0 : __Pyx_RefNannyFinishContext();
10720 0 : return __pyx_r;
10721 : }
10722 :
10723 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10724 0 : Py_ssize_t __pyx_8genexpr2__pyx_v_suboffset;
10725 0 : PyObject *__pyx_r = NULL;
10726 : __Pyx_RefNannyDeclarations
10727 0 : int __pyx_t_1;
10728 0 : PyObject *__pyx_t_2 = NULL;
10729 0 : Py_ssize_t *__pyx_t_3;
10730 0 : Py_ssize_t *__pyx_t_4;
10731 0 : Py_ssize_t *__pyx_t_5;
10732 0 : PyObject *__pyx_t_6 = NULL;
10733 0 : int __pyx_lineno = 0;
10734 0 : const char *__pyx_filename = NULL;
10735 0 : int __pyx_clineno = 0;
10736 0 : __Pyx_RefNannySetupContext("__get__", 1);
10737 :
10738 : /* "View.MemoryView":581
10739 : * @property
10740 : * def suboffsets(self):
10741 : * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
10742 : * return (-1,) * self.view.ndim
10743 : *
10744 : */
10745 0 : __pyx_t_1 = (__pyx_v_self->view.suboffsets == NULL);
10746 0 : if (__pyx_t_1) {
10747 :
10748 : /* "View.MemoryView":582
10749 : * def suboffsets(self):
10750 : * if self.view.suboffsets == NULL:
10751 : * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
10752 : *
10753 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
10754 : */
10755 0 : __Pyx_XDECREF(__pyx_r);
10756 0 : __pyx_t_2 = __Pyx_PySequence_Multiply(__pyx_tuple__4, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 582, __pyx_L1_error)
10757 0 : __Pyx_GOTREF(__pyx_t_2);
10758 0 : __pyx_r = __pyx_t_2;
10759 0 : __pyx_t_2 = 0;
10760 0 : goto __pyx_L0;
10761 :
10762 : /* "View.MemoryView":581
10763 : * @property
10764 : * def suboffsets(self):
10765 : * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
10766 : * return (-1,) * self.view.ndim
10767 : *
10768 : */
10769 : }
10770 :
10771 : /* "View.MemoryView":584
10772 : * return (-1,) * self.view.ndim
10773 : *
10774 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
10775 : *
10776 : * @property
10777 : */
10778 0 : __Pyx_XDECREF(__pyx_r);
10779 : { /* enter inner scope */
10780 0 : __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 584, __pyx_L1_error)
10781 0 : __Pyx_GOTREF(__pyx_t_2);
10782 0 : __pyx_t_4 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
10783 0 : for (__pyx_t_5 = __pyx_v_self->view.suboffsets; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
10784 0 : __pyx_t_3 = __pyx_t_5;
10785 0 : __pyx_8genexpr2__pyx_v_suboffset = (__pyx_t_3[0]);
10786 0 : __pyx_t_6 = PyInt_FromSsize_t(__pyx_8genexpr2__pyx_v_suboffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
10787 0 : __Pyx_GOTREF(__pyx_t_6);
10788 0 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 584, __pyx_L1_error)
10789 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10790 : }
10791 : } /* exit inner scope */
10792 0 : __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
10793 0 : __Pyx_GOTREF(__pyx_t_6);
10794 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10795 0 : __pyx_r = __pyx_t_6;
10796 0 : __pyx_t_6 = 0;
10797 0 : goto __pyx_L0;
10798 :
10799 : /* "View.MemoryView":579
10800 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
10801 : *
10802 : * @property # <<<<<<<<<<<<<<
10803 : * def suboffsets(self):
10804 : * if self.view.suboffsets == NULL:
10805 : */
10806 :
10807 : /* function exit code */
10808 0 : __pyx_L1_error:;
10809 0 : __Pyx_XDECREF(__pyx_t_2);
10810 0 : __Pyx_XDECREF(__pyx_t_6);
10811 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10812 0 : __pyx_r = NULL;
10813 0 : __pyx_L0:;
10814 0 : __Pyx_XGIVEREF(__pyx_r);
10815 0 : __Pyx_RefNannyFinishContext();
10816 0 : return __pyx_r;
10817 : }
10818 :
10819 : /* "View.MemoryView":586
10820 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
10821 : *
10822 : * @property # <<<<<<<<<<<<<<
10823 : * def ndim(self):
10824 : * return self.view.ndim
10825 : */
10826 :
10827 : /* Python wrapper */
10828 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
10829 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
10830 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10831 0 : PyObject *__pyx_r = 0;
10832 : __Pyx_RefNannyDeclarations
10833 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10834 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10835 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10836 :
10837 : /* function exit code */
10838 0 : __Pyx_RefNannyFinishContext();
10839 0 : return __pyx_r;
10840 : }
10841 :
10842 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10843 0 : PyObject *__pyx_r = NULL;
10844 : __Pyx_RefNannyDeclarations
10845 0 : PyObject *__pyx_t_1 = NULL;
10846 0 : int __pyx_lineno = 0;
10847 0 : const char *__pyx_filename = NULL;
10848 0 : int __pyx_clineno = 0;
10849 0 : __Pyx_RefNannySetupContext("__get__", 1);
10850 :
10851 : /* "View.MemoryView":588
10852 : * @property
10853 : * def ndim(self):
10854 : * return self.view.ndim # <<<<<<<<<<<<<<
10855 : *
10856 : * @property
10857 : */
10858 0 : __Pyx_XDECREF(__pyx_r);
10859 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 588, __pyx_L1_error)
10860 0 : __Pyx_GOTREF(__pyx_t_1);
10861 0 : __pyx_r = __pyx_t_1;
10862 0 : __pyx_t_1 = 0;
10863 0 : goto __pyx_L0;
10864 :
10865 : /* "View.MemoryView":586
10866 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
10867 : *
10868 : * @property # <<<<<<<<<<<<<<
10869 : * def ndim(self):
10870 : * return self.view.ndim
10871 : */
10872 :
10873 : /* function exit code */
10874 0 : __pyx_L1_error:;
10875 0 : __Pyx_XDECREF(__pyx_t_1);
10876 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10877 0 : __pyx_r = NULL;
10878 0 : __pyx_L0:;
10879 0 : __Pyx_XGIVEREF(__pyx_r);
10880 0 : __Pyx_RefNannyFinishContext();
10881 0 : return __pyx_r;
10882 : }
10883 :
10884 : /* "View.MemoryView":590
10885 : * return self.view.ndim
10886 : *
10887 : * @property # <<<<<<<<<<<<<<
10888 : * def itemsize(self):
10889 : * return self.view.itemsize
10890 : */
10891 :
10892 : /* Python wrapper */
10893 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
10894 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
10895 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10896 0 : PyObject *__pyx_r = 0;
10897 : __Pyx_RefNannyDeclarations
10898 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10899 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10900 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10901 :
10902 : /* function exit code */
10903 0 : __Pyx_RefNannyFinishContext();
10904 0 : return __pyx_r;
10905 : }
10906 :
10907 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10908 0 : PyObject *__pyx_r = NULL;
10909 : __Pyx_RefNannyDeclarations
10910 0 : PyObject *__pyx_t_1 = NULL;
10911 0 : int __pyx_lineno = 0;
10912 0 : const char *__pyx_filename = NULL;
10913 0 : int __pyx_clineno = 0;
10914 0 : __Pyx_RefNannySetupContext("__get__", 1);
10915 :
10916 : /* "View.MemoryView":592
10917 : * @property
10918 : * def itemsize(self):
10919 : * return self.view.itemsize # <<<<<<<<<<<<<<
10920 : *
10921 : * @property
10922 : */
10923 0 : __Pyx_XDECREF(__pyx_r);
10924 0 : __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 592, __pyx_L1_error)
10925 0 : __Pyx_GOTREF(__pyx_t_1);
10926 0 : __pyx_r = __pyx_t_1;
10927 0 : __pyx_t_1 = 0;
10928 0 : goto __pyx_L0;
10929 :
10930 : /* "View.MemoryView":590
10931 : * return self.view.ndim
10932 : *
10933 : * @property # <<<<<<<<<<<<<<
10934 : * def itemsize(self):
10935 : * return self.view.itemsize
10936 : */
10937 :
10938 : /* function exit code */
10939 0 : __pyx_L1_error:;
10940 0 : __Pyx_XDECREF(__pyx_t_1);
10941 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10942 0 : __pyx_r = NULL;
10943 0 : __pyx_L0:;
10944 0 : __Pyx_XGIVEREF(__pyx_r);
10945 0 : __Pyx_RefNannyFinishContext();
10946 0 : return __pyx_r;
10947 : }
10948 :
10949 : /* "View.MemoryView":594
10950 : * return self.view.itemsize
10951 : *
10952 : * @property # <<<<<<<<<<<<<<
10953 : * def nbytes(self):
10954 : * return self.size * self.view.itemsize
10955 : */
10956 :
10957 : /* Python wrapper */
10958 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
10959 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
10960 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10961 0 : PyObject *__pyx_r = 0;
10962 : __Pyx_RefNannyDeclarations
10963 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10964 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10965 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10966 :
10967 : /* function exit code */
10968 0 : __Pyx_RefNannyFinishContext();
10969 0 : return __pyx_r;
10970 : }
10971 :
10972 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10973 0 : PyObject *__pyx_r = NULL;
10974 : __Pyx_RefNannyDeclarations
10975 0 : PyObject *__pyx_t_1 = NULL;
10976 0 : PyObject *__pyx_t_2 = NULL;
10977 0 : PyObject *__pyx_t_3 = NULL;
10978 0 : int __pyx_lineno = 0;
10979 0 : const char *__pyx_filename = NULL;
10980 0 : int __pyx_clineno = 0;
10981 0 : __Pyx_RefNannySetupContext("__get__", 1);
10982 :
10983 : /* "View.MemoryView":596
10984 : * @property
10985 : * def nbytes(self):
10986 : * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
10987 : *
10988 : * @property
10989 : */
10990 0 : __Pyx_XDECREF(__pyx_r);
10991 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 596, __pyx_L1_error)
10992 0 : __Pyx_GOTREF(__pyx_t_1);
10993 0 : __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 596, __pyx_L1_error)
10994 0 : __Pyx_GOTREF(__pyx_t_2);
10995 0 : __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 596, __pyx_L1_error)
10996 0 : __Pyx_GOTREF(__pyx_t_3);
10997 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10998 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10999 0 : __pyx_r = __pyx_t_3;
11000 0 : __pyx_t_3 = 0;
11001 0 : goto __pyx_L0;
11002 :
11003 : /* "View.MemoryView":594
11004 : * return self.view.itemsize
11005 : *
11006 : * @property # <<<<<<<<<<<<<<
11007 : * def nbytes(self):
11008 : * return self.size * self.view.itemsize
11009 : */
11010 :
11011 : /* function exit code */
11012 0 : __pyx_L1_error:;
11013 0 : __Pyx_XDECREF(__pyx_t_1);
11014 0 : __Pyx_XDECREF(__pyx_t_2);
11015 0 : __Pyx_XDECREF(__pyx_t_3);
11016 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11017 0 : __pyx_r = NULL;
11018 0 : __pyx_L0:;
11019 0 : __Pyx_XGIVEREF(__pyx_r);
11020 0 : __Pyx_RefNannyFinishContext();
11021 0 : return __pyx_r;
11022 : }
11023 :
11024 : /* "View.MemoryView":598
11025 : * return self.size * self.view.itemsize
11026 : *
11027 : * @property # <<<<<<<<<<<<<<
11028 : * def size(self):
11029 : * if self._size is None:
11030 : */
11031 :
11032 : /* Python wrapper */
11033 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
11034 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
11035 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11036 0 : PyObject *__pyx_r = 0;
11037 : __Pyx_RefNannyDeclarations
11038 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11039 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11040 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11041 :
11042 : /* function exit code */
11043 0 : __Pyx_RefNannyFinishContext();
11044 0 : return __pyx_r;
11045 : }
11046 :
11047 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11048 0 : PyObject *__pyx_v_result = NULL;
11049 0 : PyObject *__pyx_v_length = NULL;
11050 0 : PyObject *__pyx_r = NULL;
11051 : __Pyx_RefNannyDeclarations
11052 0 : int __pyx_t_1;
11053 0 : Py_ssize_t *__pyx_t_2;
11054 0 : Py_ssize_t *__pyx_t_3;
11055 0 : Py_ssize_t *__pyx_t_4;
11056 0 : PyObject *__pyx_t_5 = NULL;
11057 0 : int __pyx_lineno = 0;
11058 0 : const char *__pyx_filename = NULL;
11059 0 : int __pyx_clineno = 0;
11060 0 : __Pyx_RefNannySetupContext("__get__", 1);
11061 :
11062 : /* "View.MemoryView":600
11063 : * @property
11064 : * def size(self):
11065 : * if self._size is None: # <<<<<<<<<<<<<<
11066 : * result = 1
11067 : *
11068 : */
11069 0 : __pyx_t_1 = (__pyx_v_self->_size == Py_None);
11070 0 : if (__pyx_t_1) {
11071 :
11072 : /* "View.MemoryView":601
11073 : * def size(self):
11074 : * if self._size is None:
11075 : * result = 1 # <<<<<<<<<<<<<<
11076 : *
11077 : * for length in self.view.shape[:self.view.ndim]:
11078 : */
11079 0 : __Pyx_INCREF(__pyx_int_1);
11080 0 : __pyx_v_result = __pyx_int_1;
11081 :
11082 : /* "View.MemoryView":603
11083 : * result = 1
11084 : *
11085 : * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
11086 : * result *= length
11087 : *
11088 : */
11089 0 : __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11090 0 : for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
11091 0 : __pyx_t_2 = __pyx_t_4;
11092 0 : __pyx_t_5 = PyInt_FromSsize_t((__pyx_t_2[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 603, __pyx_L1_error)
11093 0 : __Pyx_GOTREF(__pyx_t_5);
11094 0 : __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_5);
11095 0 : __pyx_t_5 = 0;
11096 :
11097 : /* "View.MemoryView":604
11098 : *
11099 : * for length in self.view.shape[:self.view.ndim]:
11100 : * result *= length # <<<<<<<<<<<<<<
11101 : *
11102 : * self._size = result
11103 : */
11104 0 : __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 604, __pyx_L1_error)
11105 0 : __Pyx_GOTREF(__pyx_t_5);
11106 0 : __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_5);
11107 0 : __pyx_t_5 = 0;
11108 : }
11109 :
11110 : /* "View.MemoryView":606
11111 : * result *= length
11112 : *
11113 : * self._size = result # <<<<<<<<<<<<<<
11114 : *
11115 : * return self._size
11116 : */
11117 0 : __Pyx_INCREF(__pyx_v_result);
11118 0 : __Pyx_GIVEREF(__pyx_v_result);
11119 0 : __Pyx_GOTREF(__pyx_v_self->_size);
11120 0 : __Pyx_DECREF(__pyx_v_self->_size);
11121 0 : __pyx_v_self->_size = __pyx_v_result;
11122 :
11123 : /* "View.MemoryView":600
11124 : * @property
11125 : * def size(self):
11126 : * if self._size is None: # <<<<<<<<<<<<<<
11127 : * result = 1
11128 : *
11129 : */
11130 : }
11131 :
11132 : /* "View.MemoryView":608
11133 : * self._size = result
11134 : *
11135 : * return self._size # <<<<<<<<<<<<<<
11136 : *
11137 : * def __len__(self):
11138 : */
11139 0 : __Pyx_XDECREF(__pyx_r);
11140 0 : __Pyx_INCREF(__pyx_v_self->_size);
11141 0 : __pyx_r = __pyx_v_self->_size;
11142 0 : goto __pyx_L0;
11143 :
11144 : /* "View.MemoryView":598
11145 : * return self.size * self.view.itemsize
11146 : *
11147 : * @property # <<<<<<<<<<<<<<
11148 : * def size(self):
11149 : * if self._size is None:
11150 : */
11151 :
11152 : /* function exit code */
11153 0 : __pyx_L1_error:;
11154 0 : __Pyx_XDECREF(__pyx_t_5);
11155 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11156 0 : __pyx_r = NULL;
11157 0 : __pyx_L0:;
11158 0 : __Pyx_XDECREF(__pyx_v_result);
11159 0 : __Pyx_XDECREF(__pyx_v_length);
11160 0 : __Pyx_XGIVEREF(__pyx_r);
11161 0 : __Pyx_RefNannyFinishContext();
11162 0 : return __pyx_r;
11163 : }
11164 :
11165 : /* "View.MemoryView":610
11166 : * return self._size
11167 : *
11168 : * def __len__(self): # <<<<<<<<<<<<<<
11169 : * if self.view.ndim >= 1:
11170 : * return self.view.shape[0]
11171 : */
11172 :
11173 : /* Python wrapper */
11174 : static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
11175 0 : static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
11176 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11177 0 : Py_ssize_t __pyx_r;
11178 : __Pyx_RefNannyDeclarations
11179 0 : __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
11180 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11181 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11182 :
11183 : /* function exit code */
11184 0 : __Pyx_RefNannyFinishContext();
11185 0 : return __pyx_r;
11186 : }
11187 :
11188 0 : static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
11189 0 : Py_ssize_t __pyx_r;
11190 0 : int __pyx_t_1;
11191 :
11192 : /* "View.MemoryView":611
11193 : *
11194 : * def __len__(self):
11195 : * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
11196 : * return self.view.shape[0]
11197 : *
11198 : */
11199 0 : __pyx_t_1 = (__pyx_v_self->view.ndim >= 1);
11200 0 : if (__pyx_t_1) {
11201 :
11202 : /* "View.MemoryView":612
11203 : * def __len__(self):
11204 : * if self.view.ndim >= 1:
11205 : * return self.view.shape[0] # <<<<<<<<<<<<<<
11206 : *
11207 : * return 0
11208 : */
11209 0 : __pyx_r = (__pyx_v_self->view.shape[0]);
11210 0 : goto __pyx_L0;
11211 :
11212 : /* "View.MemoryView":611
11213 : *
11214 : * def __len__(self):
11215 : * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
11216 : * return self.view.shape[0]
11217 : *
11218 : */
11219 : }
11220 :
11221 : /* "View.MemoryView":614
11222 : * return self.view.shape[0]
11223 : *
11224 : * return 0 # <<<<<<<<<<<<<<
11225 : *
11226 : * def __repr__(self):
11227 : */
11228 0 : __pyx_r = 0;
11229 0 : goto __pyx_L0;
11230 :
11231 : /* "View.MemoryView":610
11232 : * return self._size
11233 : *
11234 : * def __len__(self): # <<<<<<<<<<<<<<
11235 : * if self.view.ndim >= 1:
11236 : * return self.view.shape[0]
11237 : */
11238 :
11239 : /* function exit code */
11240 0 : __pyx_L0:;
11241 0 : return __pyx_r;
11242 : }
11243 :
11244 : /* "View.MemoryView":616
11245 : * return 0
11246 : *
11247 : * def __repr__(self): # <<<<<<<<<<<<<<
11248 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11249 : * id(self))
11250 : */
11251 :
11252 : /* Python wrapper */
11253 : static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
11254 0 : static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
11255 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11256 0 : PyObject *__pyx_r = 0;
11257 : __Pyx_RefNannyDeclarations
11258 0 : __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
11259 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11260 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11261 :
11262 : /* function exit code */
11263 0 : __Pyx_RefNannyFinishContext();
11264 0 : return __pyx_r;
11265 : }
11266 :
11267 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
11268 0 : PyObject *__pyx_r = NULL;
11269 : __Pyx_RefNannyDeclarations
11270 0 : PyObject *__pyx_t_1 = NULL;
11271 0 : PyObject *__pyx_t_2 = NULL;
11272 0 : PyObject *__pyx_t_3 = NULL;
11273 0 : int __pyx_lineno = 0;
11274 0 : const char *__pyx_filename = NULL;
11275 0 : int __pyx_clineno = 0;
11276 0 : __Pyx_RefNannySetupContext("__repr__", 1);
11277 :
11278 : /* "View.MemoryView":617
11279 : *
11280 : * def __repr__(self):
11281 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
11282 : * id(self))
11283 : *
11284 : */
11285 0 : __Pyx_XDECREF(__pyx_r);
11286 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error)
11287 0 : __Pyx_GOTREF(__pyx_t_1);
11288 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error)
11289 0 : __Pyx_GOTREF(__pyx_t_2);
11290 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11291 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error)
11292 0 : __Pyx_GOTREF(__pyx_t_1);
11293 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11294 :
11295 : /* "View.MemoryView":618
11296 : * def __repr__(self):
11297 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11298 : * id(self)) # <<<<<<<<<<<<<<
11299 : *
11300 : * def __str__(self):
11301 : */
11302 0 : __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
11303 0 : __Pyx_GOTREF(__pyx_t_2);
11304 :
11305 : /* "View.MemoryView":617
11306 : *
11307 : * def __repr__(self):
11308 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
11309 : * id(self))
11310 : *
11311 : */
11312 0 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 617, __pyx_L1_error)
11313 0 : __Pyx_GOTREF(__pyx_t_3);
11314 0 : __Pyx_GIVEREF(__pyx_t_1);
11315 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error);
11316 0 : __Pyx_GIVEREF(__pyx_t_2);
11317 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error);
11318 0 : __pyx_t_1 = 0;
11319 0 : __pyx_t_2 = 0;
11320 0 : __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error)
11321 0 : __Pyx_GOTREF(__pyx_t_2);
11322 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11323 0 : __pyx_r = __pyx_t_2;
11324 0 : __pyx_t_2 = 0;
11325 0 : goto __pyx_L0;
11326 :
11327 : /* "View.MemoryView":616
11328 : * return 0
11329 : *
11330 : * def __repr__(self): # <<<<<<<<<<<<<<
11331 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11332 : * id(self))
11333 : */
11334 :
11335 : /* function exit code */
11336 0 : __pyx_L1_error:;
11337 0 : __Pyx_XDECREF(__pyx_t_1);
11338 0 : __Pyx_XDECREF(__pyx_t_2);
11339 0 : __Pyx_XDECREF(__pyx_t_3);
11340 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11341 0 : __pyx_r = NULL;
11342 0 : __pyx_L0:;
11343 0 : __Pyx_XGIVEREF(__pyx_r);
11344 0 : __Pyx_RefNannyFinishContext();
11345 0 : return __pyx_r;
11346 : }
11347 :
11348 : /* "View.MemoryView":620
11349 : * id(self))
11350 : *
11351 : * def __str__(self): # <<<<<<<<<<<<<<
11352 : * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
11353 : *
11354 : */
11355 :
11356 : /* Python wrapper */
11357 : static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
11358 0 : static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
11359 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11360 0 : PyObject *__pyx_r = 0;
11361 : __Pyx_RefNannyDeclarations
11362 0 : __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
11363 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11364 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11365 :
11366 : /* function exit code */
11367 0 : __Pyx_RefNannyFinishContext();
11368 0 : return __pyx_r;
11369 : }
11370 :
11371 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
11372 0 : PyObject *__pyx_r = NULL;
11373 : __Pyx_RefNannyDeclarations
11374 0 : PyObject *__pyx_t_1 = NULL;
11375 0 : PyObject *__pyx_t_2 = NULL;
11376 0 : int __pyx_lineno = 0;
11377 0 : const char *__pyx_filename = NULL;
11378 0 : int __pyx_clineno = 0;
11379 0 : __Pyx_RefNannySetupContext("__str__", 1);
11380 :
11381 : /* "View.MemoryView":621
11382 : *
11383 : * def __str__(self):
11384 : * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
11385 : *
11386 : *
11387 : */
11388 0 : __Pyx_XDECREF(__pyx_r);
11389 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
11390 0 : __Pyx_GOTREF(__pyx_t_1);
11391 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 621, __pyx_L1_error)
11392 0 : __Pyx_GOTREF(__pyx_t_2);
11393 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11394 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
11395 0 : __Pyx_GOTREF(__pyx_t_1);
11396 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11397 0 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 621, __pyx_L1_error)
11398 0 : __Pyx_GOTREF(__pyx_t_2);
11399 0 : __Pyx_GIVEREF(__pyx_t_1);
11400 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error);
11401 0 : __pyx_t_1 = 0;
11402 0 : __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
11403 0 : __Pyx_GOTREF(__pyx_t_1);
11404 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11405 0 : __pyx_r = __pyx_t_1;
11406 0 : __pyx_t_1 = 0;
11407 0 : goto __pyx_L0;
11408 :
11409 : /* "View.MemoryView":620
11410 : * id(self))
11411 : *
11412 : * def __str__(self): # <<<<<<<<<<<<<<
11413 : * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
11414 : *
11415 : */
11416 :
11417 : /* function exit code */
11418 0 : __pyx_L1_error:;
11419 0 : __Pyx_XDECREF(__pyx_t_1);
11420 0 : __Pyx_XDECREF(__pyx_t_2);
11421 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11422 0 : __pyx_r = NULL;
11423 0 : __pyx_L0:;
11424 0 : __Pyx_XGIVEREF(__pyx_r);
11425 0 : __Pyx_RefNannyFinishContext();
11426 0 : return __pyx_r;
11427 : }
11428 :
11429 : /* "View.MemoryView":624
11430 : *
11431 : *
11432 : * def is_c_contig(self): # <<<<<<<<<<<<<<
11433 : * cdef __Pyx_memviewslice *mslice
11434 : * cdef __Pyx_memviewslice tmp
11435 : */
11436 :
11437 : /* Python wrapper */
11438 : static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
11439 : #if CYTHON_METH_FASTCALL
11440 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11441 : #else
11442 : PyObject *__pyx_args, PyObject *__pyx_kwds
11443 : #endif
11444 : ); /*proto*/
11445 0 : static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
11446 : #if CYTHON_METH_FASTCALL
11447 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11448 : #else
11449 : PyObject *__pyx_args, PyObject *__pyx_kwds
11450 : #endif
11451 : ) {
11452 : #if !CYTHON_METH_FASTCALL
11453 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11454 : #endif
11455 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11456 0 : PyObject *__pyx_r = 0;
11457 : __Pyx_RefNannyDeclarations
11458 0 : __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
11459 : #if !CYTHON_METH_FASTCALL
11460 : #if CYTHON_ASSUME_SAFE_MACROS
11461 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11462 : #else
11463 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11464 : #endif
11465 : #endif
11466 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11467 0 : if (unlikely(__pyx_nargs > 0)) {
11468 0 : __Pyx_RaiseArgtupleInvalid("is_c_contig", 1, 0, 0, __pyx_nargs); return NULL;}
11469 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_c_contig", 0))) return NULL;
11470 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
11471 :
11472 : /* function exit code */
11473 0 : __Pyx_RefNannyFinishContext();
11474 0 : return __pyx_r;
11475 : }
11476 :
11477 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
11478 0 : __Pyx_memviewslice *__pyx_v_mslice;
11479 0 : __Pyx_memviewslice __pyx_v_tmp;
11480 0 : PyObject *__pyx_r = NULL;
11481 : __Pyx_RefNannyDeclarations
11482 0 : __Pyx_memviewslice *__pyx_t_1;
11483 0 : PyObject *__pyx_t_2 = NULL;
11484 0 : int __pyx_lineno = 0;
11485 0 : const char *__pyx_filename = NULL;
11486 0 : int __pyx_clineno = 0;
11487 0 : __Pyx_RefNannySetupContext("is_c_contig", 1);
11488 :
11489 : /* "View.MemoryView":627
11490 : * cdef __Pyx_memviewslice *mslice
11491 : * cdef __Pyx_memviewslice tmp
11492 : * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
11493 : * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11494 : *
11495 : */
11496 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 627, __pyx_L1_error)
11497 0 : __pyx_v_mslice = __pyx_t_1;
11498 :
11499 : /* "View.MemoryView":628
11500 : * cdef __Pyx_memviewslice tmp
11501 : * mslice = get_slice_from_memview(self, &tmp)
11502 : * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
11503 : *
11504 : * def is_f_contig(self):
11505 : */
11506 0 : __Pyx_XDECREF(__pyx_r);
11507 0 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 628, __pyx_L1_error)
11508 0 : __Pyx_GOTREF(__pyx_t_2);
11509 0 : __pyx_r = __pyx_t_2;
11510 0 : __pyx_t_2 = 0;
11511 0 : goto __pyx_L0;
11512 :
11513 : /* "View.MemoryView":624
11514 : *
11515 : *
11516 : * def is_c_contig(self): # <<<<<<<<<<<<<<
11517 : * cdef __Pyx_memviewslice *mslice
11518 : * cdef __Pyx_memviewslice tmp
11519 : */
11520 :
11521 : /* function exit code */
11522 0 : __pyx_L1_error:;
11523 0 : __Pyx_XDECREF(__pyx_t_2);
11524 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11525 0 : __pyx_r = NULL;
11526 0 : __pyx_L0:;
11527 0 : __Pyx_XGIVEREF(__pyx_r);
11528 0 : __Pyx_RefNannyFinishContext();
11529 0 : return __pyx_r;
11530 : }
11531 :
11532 : /* "View.MemoryView":630
11533 : * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11534 : *
11535 : * def is_f_contig(self): # <<<<<<<<<<<<<<
11536 : * cdef __Pyx_memviewslice *mslice
11537 : * cdef __Pyx_memviewslice tmp
11538 : */
11539 :
11540 : /* Python wrapper */
11541 : static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
11542 : #if CYTHON_METH_FASTCALL
11543 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11544 : #else
11545 : PyObject *__pyx_args, PyObject *__pyx_kwds
11546 : #endif
11547 : ); /*proto*/
11548 0 : static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
11549 : #if CYTHON_METH_FASTCALL
11550 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11551 : #else
11552 : PyObject *__pyx_args, PyObject *__pyx_kwds
11553 : #endif
11554 : ) {
11555 : #if !CYTHON_METH_FASTCALL
11556 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11557 : #endif
11558 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11559 0 : PyObject *__pyx_r = 0;
11560 : __Pyx_RefNannyDeclarations
11561 0 : __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
11562 : #if !CYTHON_METH_FASTCALL
11563 : #if CYTHON_ASSUME_SAFE_MACROS
11564 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11565 : #else
11566 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11567 : #endif
11568 : #endif
11569 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11570 0 : if (unlikely(__pyx_nargs > 0)) {
11571 0 : __Pyx_RaiseArgtupleInvalid("is_f_contig", 1, 0, 0, __pyx_nargs); return NULL;}
11572 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_f_contig", 0))) return NULL;
11573 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
11574 :
11575 : /* function exit code */
11576 0 : __Pyx_RefNannyFinishContext();
11577 0 : return __pyx_r;
11578 : }
11579 :
11580 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
11581 0 : __Pyx_memviewslice *__pyx_v_mslice;
11582 0 : __Pyx_memviewslice __pyx_v_tmp;
11583 0 : PyObject *__pyx_r = NULL;
11584 : __Pyx_RefNannyDeclarations
11585 0 : __Pyx_memviewslice *__pyx_t_1;
11586 0 : PyObject *__pyx_t_2 = NULL;
11587 0 : int __pyx_lineno = 0;
11588 0 : const char *__pyx_filename = NULL;
11589 0 : int __pyx_clineno = 0;
11590 0 : __Pyx_RefNannySetupContext("is_f_contig", 1);
11591 :
11592 : /* "View.MemoryView":633
11593 : * cdef __Pyx_memviewslice *mslice
11594 : * cdef __Pyx_memviewslice tmp
11595 : * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
11596 : * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11597 : *
11598 : */
11599 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 633, __pyx_L1_error)
11600 0 : __pyx_v_mslice = __pyx_t_1;
11601 :
11602 : /* "View.MemoryView":634
11603 : * cdef __Pyx_memviewslice tmp
11604 : * mslice = get_slice_from_memview(self, &tmp)
11605 : * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
11606 : *
11607 : * def copy(self):
11608 : */
11609 0 : __Pyx_XDECREF(__pyx_r);
11610 0 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 634, __pyx_L1_error)
11611 0 : __Pyx_GOTREF(__pyx_t_2);
11612 0 : __pyx_r = __pyx_t_2;
11613 0 : __pyx_t_2 = 0;
11614 0 : goto __pyx_L0;
11615 :
11616 : /* "View.MemoryView":630
11617 : * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11618 : *
11619 : * def is_f_contig(self): # <<<<<<<<<<<<<<
11620 : * cdef __Pyx_memviewslice *mslice
11621 : * cdef __Pyx_memviewslice tmp
11622 : */
11623 :
11624 : /* function exit code */
11625 0 : __pyx_L1_error:;
11626 0 : __Pyx_XDECREF(__pyx_t_2);
11627 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11628 0 : __pyx_r = NULL;
11629 0 : __pyx_L0:;
11630 0 : __Pyx_XGIVEREF(__pyx_r);
11631 0 : __Pyx_RefNannyFinishContext();
11632 0 : return __pyx_r;
11633 : }
11634 :
11635 : /* "View.MemoryView":636
11636 : * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11637 : *
11638 : * def copy(self): # <<<<<<<<<<<<<<
11639 : * cdef __Pyx_memviewslice mslice
11640 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11641 : */
11642 :
11643 : /* Python wrapper */
11644 : static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
11645 : #if CYTHON_METH_FASTCALL
11646 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11647 : #else
11648 : PyObject *__pyx_args, PyObject *__pyx_kwds
11649 : #endif
11650 : ); /*proto*/
11651 0 : static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
11652 : #if CYTHON_METH_FASTCALL
11653 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11654 : #else
11655 : PyObject *__pyx_args, PyObject *__pyx_kwds
11656 : #endif
11657 : ) {
11658 : #if !CYTHON_METH_FASTCALL
11659 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11660 : #endif
11661 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11662 0 : PyObject *__pyx_r = 0;
11663 : __Pyx_RefNannyDeclarations
11664 0 : __Pyx_RefNannySetupContext("copy (wrapper)", 0);
11665 : #if !CYTHON_METH_FASTCALL
11666 : #if CYTHON_ASSUME_SAFE_MACROS
11667 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11668 : #else
11669 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11670 : #endif
11671 : #endif
11672 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11673 0 : if (unlikely(__pyx_nargs > 0)) {
11674 0 : __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL;}
11675 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy", 0))) return NULL;
11676 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
11677 :
11678 : /* function exit code */
11679 0 : __Pyx_RefNannyFinishContext();
11680 0 : return __pyx_r;
11681 : }
11682 :
11683 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
11684 0 : __Pyx_memviewslice __pyx_v_mslice;
11685 0 : int __pyx_v_flags;
11686 0 : PyObject *__pyx_r = NULL;
11687 : __Pyx_RefNannyDeclarations
11688 0 : __Pyx_memviewslice __pyx_t_1;
11689 0 : PyObject *__pyx_t_2 = NULL;
11690 0 : int __pyx_lineno = 0;
11691 0 : const char *__pyx_filename = NULL;
11692 0 : int __pyx_clineno = 0;
11693 0 : __Pyx_RefNannySetupContext("copy", 1);
11694 :
11695 : /* "View.MemoryView":638
11696 : * def copy(self):
11697 : * cdef __Pyx_memviewslice mslice
11698 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
11699 : *
11700 : * slice_copy(self, &mslice)
11701 : */
11702 0 : __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
11703 :
11704 : /* "View.MemoryView":640
11705 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11706 : *
11707 : * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
11708 : * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
11709 : * self.view.itemsize,
11710 : */
11711 0 : __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
11712 :
11713 : /* "View.MemoryView":641
11714 : *
11715 : * slice_copy(self, &mslice)
11716 : * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
11717 : * self.view.itemsize,
11718 : * flags|PyBUF_C_CONTIGUOUS,
11719 : */
11720 0 : __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 641, __pyx_L1_error)
11721 0 : __pyx_v_mslice = __pyx_t_1;
11722 :
11723 : /* "View.MemoryView":646
11724 : * self.dtype_is_object)
11725 : *
11726 : * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
11727 : *
11728 : * def copy_fortran(self):
11729 : */
11730 0 : __Pyx_XDECREF(__pyx_r);
11731 0 : __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 646, __pyx_L1_error)
11732 0 : __Pyx_GOTREF(__pyx_t_2);
11733 0 : __pyx_r = __pyx_t_2;
11734 0 : __pyx_t_2 = 0;
11735 0 : goto __pyx_L0;
11736 :
11737 : /* "View.MemoryView":636
11738 : * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11739 : *
11740 : * def copy(self): # <<<<<<<<<<<<<<
11741 : * cdef __Pyx_memviewslice mslice
11742 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11743 : */
11744 :
11745 : /* function exit code */
11746 0 : __pyx_L1_error:;
11747 0 : __Pyx_XDECREF(__pyx_t_2);
11748 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
11749 0 : __pyx_r = NULL;
11750 0 : __pyx_L0:;
11751 0 : __Pyx_XGIVEREF(__pyx_r);
11752 0 : __Pyx_RefNannyFinishContext();
11753 0 : return __pyx_r;
11754 : }
11755 :
11756 : /* "View.MemoryView":648
11757 : * return memoryview_copy_from_slice(self, &mslice)
11758 : *
11759 : * def copy_fortran(self): # <<<<<<<<<<<<<<
11760 : * cdef __Pyx_memviewslice src, dst
11761 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
11762 : */
11763 :
11764 : /* Python wrapper */
11765 : static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
11766 : #if CYTHON_METH_FASTCALL
11767 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11768 : #else
11769 : PyObject *__pyx_args, PyObject *__pyx_kwds
11770 : #endif
11771 : ); /*proto*/
11772 0 : static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
11773 : #if CYTHON_METH_FASTCALL
11774 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11775 : #else
11776 : PyObject *__pyx_args, PyObject *__pyx_kwds
11777 : #endif
11778 : ) {
11779 : #if !CYTHON_METH_FASTCALL
11780 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11781 : #endif
11782 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11783 0 : PyObject *__pyx_r = 0;
11784 : __Pyx_RefNannyDeclarations
11785 0 : __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
11786 : #if !CYTHON_METH_FASTCALL
11787 : #if CYTHON_ASSUME_SAFE_MACROS
11788 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11789 : #else
11790 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11791 : #endif
11792 : #endif
11793 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11794 0 : if (unlikely(__pyx_nargs > 0)) {
11795 0 : __Pyx_RaiseArgtupleInvalid("copy_fortran", 1, 0, 0, __pyx_nargs); return NULL;}
11796 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy_fortran", 0))) return NULL;
11797 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
11798 :
11799 : /* function exit code */
11800 0 : __Pyx_RefNannyFinishContext();
11801 0 : return __pyx_r;
11802 : }
11803 :
11804 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
11805 0 : __Pyx_memviewslice __pyx_v_src;
11806 0 : __Pyx_memviewslice __pyx_v_dst;
11807 0 : int __pyx_v_flags;
11808 0 : PyObject *__pyx_r = NULL;
11809 : __Pyx_RefNannyDeclarations
11810 0 : __Pyx_memviewslice __pyx_t_1;
11811 0 : PyObject *__pyx_t_2 = NULL;
11812 0 : int __pyx_lineno = 0;
11813 0 : const char *__pyx_filename = NULL;
11814 0 : int __pyx_clineno = 0;
11815 0 : __Pyx_RefNannySetupContext("copy_fortran", 1);
11816 :
11817 : /* "View.MemoryView":650
11818 : * def copy_fortran(self):
11819 : * cdef __Pyx_memviewslice src, dst
11820 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
11821 : *
11822 : * slice_copy(self, &src)
11823 : */
11824 0 : __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
11825 :
11826 : /* "View.MemoryView":652
11827 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
11828 : *
11829 : * slice_copy(self, &src) # <<<<<<<<<<<<<<
11830 : * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
11831 : * self.view.itemsize,
11832 : */
11833 0 : __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
11834 :
11835 : /* "View.MemoryView":653
11836 : *
11837 : * slice_copy(self, &src)
11838 : * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
11839 : * self.view.itemsize,
11840 : * flags|PyBUF_F_CONTIGUOUS,
11841 : */
11842 0 : __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 653, __pyx_L1_error)
11843 0 : __pyx_v_dst = __pyx_t_1;
11844 :
11845 : /* "View.MemoryView":658
11846 : * self.dtype_is_object)
11847 : *
11848 : * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
11849 : *
11850 : *
11851 : */
11852 0 : __Pyx_XDECREF(__pyx_r);
11853 0 : __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
11854 0 : __Pyx_GOTREF(__pyx_t_2);
11855 0 : __pyx_r = __pyx_t_2;
11856 0 : __pyx_t_2 = 0;
11857 0 : goto __pyx_L0;
11858 :
11859 : /* "View.MemoryView":648
11860 : * return memoryview_copy_from_slice(self, &mslice)
11861 : *
11862 : * def copy_fortran(self): # <<<<<<<<<<<<<<
11863 : * cdef __Pyx_memviewslice src, dst
11864 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
11865 : */
11866 :
11867 : /* function exit code */
11868 0 : __pyx_L1_error:;
11869 0 : __Pyx_XDECREF(__pyx_t_2);
11870 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
11871 0 : __pyx_r = NULL;
11872 0 : __pyx_L0:;
11873 0 : __Pyx_XGIVEREF(__pyx_r);
11874 0 : __Pyx_RefNannyFinishContext();
11875 0 : return __pyx_r;
11876 : }
11877 :
11878 : /* "(tree fragment)":1
11879 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11880 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11881 : * def __setstate_cython__(self, __pyx_state):
11882 : */
11883 :
11884 : /* Python wrapper */
11885 : static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
11886 : #if CYTHON_METH_FASTCALL
11887 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11888 : #else
11889 : PyObject *__pyx_args, PyObject *__pyx_kwds
11890 : #endif
11891 : ); /*proto*/
11892 0 : static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
11893 : #if CYTHON_METH_FASTCALL
11894 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11895 : #else
11896 : PyObject *__pyx_args, PyObject *__pyx_kwds
11897 : #endif
11898 : ) {
11899 : #if !CYTHON_METH_FASTCALL
11900 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11901 : #endif
11902 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11903 0 : PyObject *__pyx_r = 0;
11904 : __Pyx_RefNannyDeclarations
11905 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
11906 : #if !CYTHON_METH_FASTCALL
11907 : #if CYTHON_ASSUME_SAFE_MACROS
11908 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11909 : #else
11910 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11911 : #endif
11912 : #endif
11913 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11914 0 : if (unlikely(__pyx_nargs > 0)) {
11915 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
11916 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
11917 0 : __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11918 :
11919 : /* function exit code */
11920 0 : __Pyx_RefNannyFinishContext();
11921 0 : return __pyx_r;
11922 : }
11923 :
11924 0 : static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
11925 0 : PyObject *__pyx_r = NULL;
11926 : __Pyx_RefNannyDeclarations
11927 0 : int __pyx_lineno = 0;
11928 0 : const char *__pyx_filename = NULL;
11929 0 : int __pyx_clineno = 0;
11930 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
11931 :
11932 : /* "(tree fragment)":2
11933 : * def __reduce_cython__(self):
11934 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
11935 : * def __setstate_cython__(self, __pyx_state):
11936 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11937 : */
11938 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
11939 0 : __PYX_ERR(1, 2, __pyx_L1_error)
11940 :
11941 : /* "(tree fragment)":1
11942 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11943 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11944 : * def __setstate_cython__(self, __pyx_state):
11945 : */
11946 :
11947 : /* function exit code */
11948 0 : __pyx_L1_error:;
11949 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11950 0 : __pyx_r = NULL;
11951 0 : __Pyx_XGIVEREF(__pyx_r);
11952 0 : __Pyx_RefNannyFinishContext();
11953 0 : return __pyx_r;
11954 : }
11955 :
11956 : /* "(tree fragment)":3
11957 : * def __reduce_cython__(self):
11958 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11959 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11960 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11961 : */
11962 :
11963 : /* Python wrapper */
11964 : static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
11965 : #if CYTHON_METH_FASTCALL
11966 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11967 : #else
11968 : PyObject *__pyx_args, PyObject *__pyx_kwds
11969 : #endif
11970 : ); /*proto*/
11971 0 : static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
11972 : #if CYTHON_METH_FASTCALL
11973 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11974 : #else
11975 : PyObject *__pyx_args, PyObject *__pyx_kwds
11976 : #endif
11977 : ) {
11978 0 : CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
11979 : #if !CYTHON_METH_FASTCALL
11980 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11981 : #endif
11982 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11983 0 : PyObject* values[1] = {0};
11984 0 : int __pyx_lineno = 0;
11985 0 : const char *__pyx_filename = NULL;
11986 0 : int __pyx_clineno = 0;
11987 0 : PyObject *__pyx_r = 0;
11988 : __Pyx_RefNannyDeclarations
11989 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
11990 : #if !CYTHON_METH_FASTCALL
11991 : #if CYTHON_ASSUME_SAFE_MACROS
11992 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11993 : #else
11994 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11995 : #endif
11996 : #endif
11997 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11998 : {
11999 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
12000 0 : if (__pyx_kwds) {
12001 0 : Py_ssize_t kw_args;
12002 0 : switch (__pyx_nargs) {
12003 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
12004 0 : CYTHON_FALLTHROUGH;
12005 0 : case 0: break;
12006 0 : default: goto __pyx_L5_argtuple_error;
12007 : }
12008 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
12009 0 : switch (__pyx_nargs) {
12010 : case 0:
12011 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
12012 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
12013 0 : kw_args--;
12014 : }
12015 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
12016 0 : else goto __pyx_L5_argtuple_error;
12017 : }
12018 0 : if (unlikely(kw_args > 0)) {
12019 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
12020 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
12021 : }
12022 0 : } else if (unlikely(__pyx_nargs != 1)) {
12023 0 : goto __pyx_L5_argtuple_error;
12024 : } else {
12025 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
12026 : }
12027 0 : __pyx_v___pyx_state = values[0];
12028 : }
12029 0 : goto __pyx_L6_skip;
12030 0 : __pyx_L5_argtuple_error:;
12031 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
12032 0 : __pyx_L6_skip:;
12033 0 : goto __pyx_L4_argument_unpacking_done;
12034 0 : __pyx_L3_error:;
12035 : {
12036 0 : Py_ssize_t __pyx_temp;
12037 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
12038 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
12039 : }
12040 : }
12041 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12042 0 : __Pyx_RefNannyFinishContext();
12043 0 : return NULL;
12044 0 : __pyx_L4_argument_unpacking_done:;
12045 0 : __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v___pyx_state);
12046 :
12047 : /* function exit code */
12048 : {
12049 0 : Py_ssize_t __pyx_temp;
12050 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
12051 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
12052 : }
12053 : }
12054 : __Pyx_RefNannyFinishContext();
12055 : return __pyx_r;
12056 : }
12057 :
12058 0 : static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
12059 0 : PyObject *__pyx_r = NULL;
12060 : __Pyx_RefNannyDeclarations
12061 0 : int __pyx_lineno = 0;
12062 0 : const char *__pyx_filename = NULL;
12063 0 : int __pyx_clineno = 0;
12064 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
12065 :
12066 : /* "(tree fragment)":4
12067 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12068 : * def __setstate_cython__(self, __pyx_state):
12069 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
12070 : */
12071 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
12072 0 : __PYX_ERR(1, 4, __pyx_L1_error)
12073 :
12074 : /* "(tree fragment)":3
12075 : * def __reduce_cython__(self):
12076 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12077 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
12078 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12079 : */
12080 :
12081 : /* function exit code */
12082 0 : __pyx_L1_error:;
12083 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12084 0 : __pyx_r = NULL;
12085 0 : __Pyx_XGIVEREF(__pyx_r);
12086 0 : __Pyx_RefNannyFinishContext();
12087 0 : return __pyx_r;
12088 : }
12089 :
12090 : /* "View.MemoryView":662
12091 : *
12092 : * @cname('__pyx_memoryview_new')
12093 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
12094 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12095 : * result.typeinfo = typeinfo
12096 : */
12097 :
12098 0 : static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
12099 0 : struct __pyx_memoryview_obj *__pyx_v_result = 0;
12100 0 : PyObject *__pyx_r = NULL;
12101 : __Pyx_RefNannyDeclarations
12102 0 : PyObject *__pyx_t_1 = NULL;
12103 0 : PyObject *__pyx_t_2 = NULL;
12104 0 : PyObject *__pyx_t_3 = NULL;
12105 0 : int __pyx_lineno = 0;
12106 0 : const char *__pyx_filename = NULL;
12107 0 : int __pyx_clineno = 0;
12108 0 : __Pyx_RefNannySetupContext("memoryview_cwrapper", 1);
12109 :
12110 : /* "View.MemoryView":663
12111 : * @cname('__pyx_memoryview_new')
12112 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
12113 : * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
12114 : * result.typeinfo = typeinfo
12115 : * return result
12116 : */
12117 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 663, __pyx_L1_error)
12118 0 : __Pyx_GOTREF(__pyx_t_1);
12119 0 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error)
12120 0 : __Pyx_GOTREF(__pyx_t_2);
12121 0 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 663, __pyx_L1_error)
12122 0 : __Pyx_GOTREF(__pyx_t_3);
12123 0 : __Pyx_INCREF(__pyx_v_o);
12124 0 : __Pyx_GIVEREF(__pyx_v_o);
12125 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o)) __PYX_ERR(1, 663, __pyx_L1_error);
12126 0 : __Pyx_GIVEREF(__pyx_t_1);
12127 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 663, __pyx_L1_error);
12128 0 : __Pyx_GIVEREF(__pyx_t_2);
12129 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error);
12130 0 : __pyx_t_1 = 0;
12131 0 : __pyx_t_2 = 0;
12132 0 : __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error)
12133 0 : __Pyx_GOTREF(__pyx_t_2);
12134 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12135 0 : __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
12136 0 : __pyx_t_2 = 0;
12137 :
12138 : /* "View.MemoryView":664
12139 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
12140 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12141 : * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
12142 : * return result
12143 : *
12144 : */
12145 0 : __pyx_v_result->typeinfo = __pyx_v_typeinfo;
12146 :
12147 : /* "View.MemoryView":665
12148 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12149 : * result.typeinfo = typeinfo
12150 : * return result # <<<<<<<<<<<<<<
12151 : *
12152 : * @cname('__pyx_memoryview_check')
12153 : */
12154 0 : __Pyx_XDECREF(__pyx_r);
12155 0 : __Pyx_INCREF((PyObject *)__pyx_v_result);
12156 0 : __pyx_r = ((PyObject *)__pyx_v_result);
12157 0 : goto __pyx_L0;
12158 :
12159 : /* "View.MemoryView":662
12160 : *
12161 : * @cname('__pyx_memoryview_new')
12162 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
12163 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12164 : * result.typeinfo = typeinfo
12165 : */
12166 :
12167 : /* function exit code */
12168 0 : __pyx_L1_error:;
12169 0 : __Pyx_XDECREF(__pyx_t_1);
12170 0 : __Pyx_XDECREF(__pyx_t_2);
12171 0 : __Pyx_XDECREF(__pyx_t_3);
12172 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
12173 0 : __pyx_r = 0;
12174 0 : __pyx_L0:;
12175 0 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
12176 0 : __Pyx_XGIVEREF(__pyx_r);
12177 0 : __Pyx_RefNannyFinishContext();
12178 0 : return __pyx_r;
12179 : }
12180 :
12181 : /* "View.MemoryView":668
12182 : *
12183 : * @cname('__pyx_memoryview_check')
12184 : * cdef inline bint memoryview_check(object o) noexcept: # <<<<<<<<<<<<<<
12185 : * return isinstance(o, memoryview)
12186 : *
12187 : */
12188 :
12189 0 : static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
12190 0 : int __pyx_r;
12191 0 : int __pyx_t_1;
12192 :
12193 : /* "View.MemoryView":669
12194 : * @cname('__pyx_memoryview_check')
12195 : * cdef inline bint memoryview_check(object o) noexcept:
12196 : * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
12197 : *
12198 : * cdef tuple _unellipsify(object index, int ndim):
12199 : */
12200 0 : __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
12201 0 : __pyx_r = __pyx_t_1;
12202 0 : goto __pyx_L0;
12203 :
12204 : /* "View.MemoryView":668
12205 : *
12206 : * @cname('__pyx_memoryview_check')
12207 : * cdef inline bint memoryview_check(object o) noexcept: # <<<<<<<<<<<<<<
12208 : * return isinstance(o, memoryview)
12209 : *
12210 : */
12211 :
12212 : /* function exit code */
12213 0 : __pyx_L0:;
12214 0 : return __pyx_r;
12215 : }
12216 :
12217 : /* "View.MemoryView":671
12218 : * return isinstance(o, memoryview)
12219 : *
12220 : * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
12221 : * """
12222 : * Replace all ellipses with full slices and fill incomplete indices with
12223 : */
12224 :
12225 0 : static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
12226 0 : Py_ssize_t __pyx_v_idx;
12227 0 : PyObject *__pyx_v_tup = NULL;
12228 0 : PyObject *__pyx_v_result = NULL;
12229 0 : int __pyx_v_have_slices;
12230 0 : int __pyx_v_seen_ellipsis;
12231 0 : PyObject *__pyx_v_item = NULL;
12232 0 : Py_ssize_t __pyx_v_nslices;
12233 0 : PyObject *__pyx_r = NULL;
12234 : __Pyx_RefNannyDeclarations
12235 0 : PyObject *__pyx_t_1 = NULL;
12236 0 : int __pyx_t_2;
12237 0 : PyObject *__pyx_t_3 = NULL;
12238 0 : Py_ssize_t __pyx_t_4;
12239 0 : Py_ssize_t __pyx_t_5;
12240 0 : Py_UCS4 __pyx_t_6;
12241 0 : PyObject *__pyx_t_7 = NULL;
12242 0 : int __pyx_lineno = 0;
12243 0 : const char *__pyx_filename = NULL;
12244 0 : int __pyx_clineno = 0;
12245 0 : __Pyx_RefNannySetupContext("_unellipsify", 1);
12246 :
12247 : /* "View.MemoryView":677
12248 : * """
12249 : * cdef Py_ssize_t idx
12250 : * tup = <tuple>index if isinstance(index, tuple) else (index,) # <<<<<<<<<<<<<<
12251 : *
12252 : * result = [slice(None)] * ndim
12253 : */
12254 0 : __pyx_t_2 = PyTuple_Check(__pyx_v_index);
12255 0 : if (__pyx_t_2) {
12256 0 : __Pyx_INCREF(((PyObject*)__pyx_v_index));
12257 : __pyx_t_1 = __pyx_v_index;
12258 : } else {
12259 0 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 677, __pyx_L1_error)
12260 0 : __Pyx_GOTREF(__pyx_t_3);
12261 0 : __Pyx_INCREF(__pyx_v_index);
12262 0 : __Pyx_GIVEREF(__pyx_v_index);
12263 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index)) __PYX_ERR(1, 677, __pyx_L1_error);
12264 0 : __pyx_t_1 = __pyx_t_3;
12265 0 : __pyx_t_3 = 0;
12266 : }
12267 0 : __pyx_v_tup = ((PyObject*)__pyx_t_1);
12268 0 : __pyx_t_1 = 0;
12269 :
12270 : /* "View.MemoryView":679
12271 : * tup = <tuple>index if isinstance(index, tuple) else (index,)
12272 : *
12273 : * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
12274 : * have_slices = False
12275 : * seen_ellipsis = False
12276 : */
12277 0 : __pyx_t_1 = PyList_New(1 * ((__pyx_v_ndim<0) ? 0:__pyx_v_ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 679, __pyx_L1_error)
12278 : __Pyx_GOTREF(__pyx_t_1);
12279 : { Py_ssize_t __pyx_temp;
12280 0 : for (__pyx_temp=0; __pyx_temp < __pyx_v_ndim; __pyx_temp++) {
12281 0 : __Pyx_INCREF(__pyx_slice__5);
12282 0 : __Pyx_GIVEREF(__pyx_slice__5);
12283 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_slice__5)) __PYX_ERR(1, 679, __pyx_L1_error);
12284 : }
12285 : }
12286 0 : __pyx_v_result = ((PyObject*)__pyx_t_1);
12287 0 : __pyx_t_1 = 0;
12288 :
12289 : /* "View.MemoryView":680
12290 : *
12291 : * result = [slice(None)] * ndim
12292 : * have_slices = False # <<<<<<<<<<<<<<
12293 : * seen_ellipsis = False
12294 : * idx = 0
12295 : */
12296 0 : __pyx_v_have_slices = 0;
12297 :
12298 : /* "View.MemoryView":681
12299 : * result = [slice(None)] * ndim
12300 : * have_slices = False
12301 : * seen_ellipsis = False # <<<<<<<<<<<<<<
12302 : * idx = 0
12303 : * for item in tup:
12304 : */
12305 0 : __pyx_v_seen_ellipsis = 0;
12306 :
12307 : /* "View.MemoryView":682
12308 : * have_slices = False
12309 : * seen_ellipsis = False
12310 : * idx = 0 # <<<<<<<<<<<<<<
12311 : * for item in tup:
12312 : * if item is Ellipsis:
12313 : */
12314 0 : __pyx_v_idx = 0;
12315 :
12316 : /* "View.MemoryView":683
12317 : * seen_ellipsis = False
12318 : * idx = 0
12319 : * for item in tup: # <<<<<<<<<<<<<<
12320 : * if item is Ellipsis:
12321 : * if not seen_ellipsis:
12322 : */
12323 0 : if (unlikely(__pyx_v_tup == Py_None)) {
12324 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
12325 0 : __PYX_ERR(1, 683, __pyx_L1_error)
12326 : }
12327 0 : __pyx_t_1 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_1);
12328 : __pyx_t_4 = 0;
12329 0 : for (;;) {
12330 0 : {
12331 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
12332 : #if !CYTHON_ASSUME_SAFE_MACROS
12333 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 683, __pyx_L1_error)
12334 : #endif
12335 0 : if (__pyx_t_4 >= __pyx_temp) break;
12336 : }
12337 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12338 0 : __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(1, 683, __pyx_L1_error)
12339 : #else
12340 : __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 683, __pyx_L1_error)
12341 : __Pyx_GOTREF(__pyx_t_3);
12342 : #endif
12343 0 : __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
12344 0 : __pyx_t_3 = 0;
12345 :
12346 : /* "View.MemoryView":684
12347 : * idx = 0
12348 : * for item in tup:
12349 : * if item is Ellipsis: # <<<<<<<<<<<<<<
12350 : * if not seen_ellipsis:
12351 : * idx += ndim - len(tup)
12352 : */
12353 0 : __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
12354 0 : if (__pyx_t_2) {
12355 :
12356 : /* "View.MemoryView":685
12357 : * for item in tup:
12358 : * if item is Ellipsis:
12359 : * if not seen_ellipsis: # <<<<<<<<<<<<<<
12360 : * idx += ndim - len(tup)
12361 : * seen_ellipsis = True
12362 : */
12363 0 : __pyx_t_2 = (!__pyx_v_seen_ellipsis);
12364 0 : if (__pyx_t_2) {
12365 :
12366 : /* "View.MemoryView":686
12367 : * if item is Ellipsis:
12368 : * if not seen_ellipsis:
12369 : * idx += ndim - len(tup) # <<<<<<<<<<<<<<
12370 : * seen_ellipsis = True
12371 : * have_slices = True
12372 : */
12373 0 : if (unlikely(__pyx_v_tup == Py_None)) {
12374 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
12375 : __PYX_ERR(1, 686, __pyx_L1_error)
12376 : }
12377 0 : __pyx_t_5 = __Pyx_PyTuple_GET_SIZE(__pyx_v_tup); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 686, __pyx_L1_error)
12378 0 : __pyx_v_idx = (__pyx_v_idx + (__pyx_v_ndim - __pyx_t_5));
12379 :
12380 : /* "View.MemoryView":687
12381 : * if not seen_ellipsis:
12382 : * idx += ndim - len(tup)
12383 : * seen_ellipsis = True # <<<<<<<<<<<<<<
12384 : * have_slices = True
12385 : * else:
12386 : */
12387 0 : __pyx_v_seen_ellipsis = 1;
12388 :
12389 : /* "View.MemoryView":685
12390 : * for item in tup:
12391 : * if item is Ellipsis:
12392 : * if not seen_ellipsis: # <<<<<<<<<<<<<<
12393 : * idx += ndim - len(tup)
12394 : * seen_ellipsis = True
12395 : */
12396 : }
12397 :
12398 : /* "View.MemoryView":688
12399 : * idx += ndim - len(tup)
12400 : * seen_ellipsis = True
12401 : * have_slices = True # <<<<<<<<<<<<<<
12402 : * else:
12403 : * if isinstance(item, slice):
12404 : */
12405 0 : __pyx_v_have_slices = 1;
12406 :
12407 : /* "View.MemoryView":684
12408 : * idx = 0
12409 : * for item in tup:
12410 : * if item is Ellipsis: # <<<<<<<<<<<<<<
12411 : * if not seen_ellipsis:
12412 : * idx += ndim - len(tup)
12413 : */
12414 0 : goto __pyx_L5;
12415 : }
12416 :
12417 : /* "View.MemoryView":690
12418 : * have_slices = True
12419 : * else:
12420 : * if isinstance(item, slice): # <<<<<<<<<<<<<<
12421 : * have_slices = True
12422 : * elif not PyIndex_Check(item):
12423 : */
12424 : /*else*/ {
12425 0 : __pyx_t_2 = PySlice_Check(__pyx_v_item);
12426 0 : if (__pyx_t_2) {
12427 :
12428 : /* "View.MemoryView":691
12429 : * else:
12430 : * if isinstance(item, slice):
12431 : * have_slices = True # <<<<<<<<<<<<<<
12432 : * elif not PyIndex_Check(item):
12433 : * raise TypeError, f"Cannot index with type '{type(item)}'"
12434 : */
12435 0 : __pyx_v_have_slices = 1;
12436 :
12437 : /* "View.MemoryView":690
12438 : * have_slices = True
12439 : * else:
12440 : * if isinstance(item, slice): # <<<<<<<<<<<<<<
12441 : * have_slices = True
12442 : * elif not PyIndex_Check(item):
12443 : */
12444 0 : goto __pyx_L7;
12445 : }
12446 :
12447 : /* "View.MemoryView":692
12448 : * if isinstance(item, slice):
12449 : * have_slices = True
12450 : * elif not PyIndex_Check(item): # <<<<<<<<<<<<<<
12451 : * raise TypeError, f"Cannot index with type '{type(item)}'"
12452 : * result[idx] = item
12453 : */
12454 0 : __pyx_t_2 = (!(PyIndex_Check(__pyx_v_item) != 0));
12455 0 : if (unlikely(__pyx_t_2)) {
12456 :
12457 : /* "View.MemoryView":693
12458 : * have_slices = True
12459 : * elif not PyIndex_Check(item):
12460 : * raise TypeError, f"Cannot index with type '{type(item)}'" # <<<<<<<<<<<<<<
12461 : * result[idx] = item
12462 : * idx += 1
12463 : */
12464 0 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 693, __pyx_L1_error)
12465 0 : __Pyx_GOTREF(__pyx_t_3);
12466 0 : __pyx_t_5 = 0;
12467 0 : __pyx_t_6 = 127;
12468 0 : __Pyx_INCREF(__pyx_kp_u_Cannot_index_with_type);
12469 0 : __pyx_t_5 += 24;
12470 0 : __Pyx_GIVEREF(__pyx_kp_u_Cannot_index_with_type);
12471 0 : PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Cannot_index_with_type);
12472 0 : __pyx_t_7 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_item)), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 693, __pyx_L1_error)
12473 0 : __Pyx_GOTREF(__pyx_t_7);
12474 0 : __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
12475 0 : __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
12476 0 : __Pyx_GIVEREF(__pyx_t_7);
12477 0 : PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
12478 0 : __pyx_t_7 = 0;
12479 0 : __Pyx_INCREF(__pyx_kp_u__6);
12480 0 : __pyx_t_5 += 1;
12481 0 : __Pyx_GIVEREF(__pyx_kp_u__6);
12482 0 : PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__6);
12483 0 : __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 693, __pyx_L1_error)
12484 0 : __Pyx_GOTREF(__pyx_t_7);
12485 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12486 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_7, 0, 0);
12487 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12488 0 : __PYX_ERR(1, 693, __pyx_L1_error)
12489 :
12490 : /* "View.MemoryView":692
12491 : * if isinstance(item, slice):
12492 : * have_slices = True
12493 : * elif not PyIndex_Check(item): # <<<<<<<<<<<<<<
12494 : * raise TypeError, f"Cannot index with type '{type(item)}'"
12495 : * result[idx] = item
12496 : */
12497 : }
12498 0 : __pyx_L7:;
12499 :
12500 : /* "View.MemoryView":694
12501 : * elif not PyIndex_Check(item):
12502 : * raise TypeError, f"Cannot index with type '{type(item)}'"
12503 : * result[idx] = item # <<<<<<<<<<<<<<
12504 : * idx += 1
12505 : *
12506 : */
12507 0 : if (unlikely((__Pyx_SetItemInt(__pyx_v_result, __pyx_v_idx, __pyx_v_item, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0))) __PYX_ERR(1, 694, __pyx_L1_error)
12508 : }
12509 0 : __pyx_L5:;
12510 :
12511 : /* "View.MemoryView":695
12512 : * raise TypeError, f"Cannot index with type '{type(item)}'"
12513 : * result[idx] = item
12514 : * idx += 1 # <<<<<<<<<<<<<<
12515 : *
12516 : * nslices = ndim - idx
12517 : */
12518 0 : __pyx_v_idx = (__pyx_v_idx + 1);
12519 :
12520 : /* "View.MemoryView":683
12521 : * seen_ellipsis = False
12522 : * idx = 0
12523 : * for item in tup: # <<<<<<<<<<<<<<
12524 : * if item is Ellipsis:
12525 : * if not seen_ellipsis:
12526 : */
12527 : }
12528 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12529 :
12530 : /* "View.MemoryView":697
12531 : * idx += 1
12532 : *
12533 : * nslices = ndim - idx # <<<<<<<<<<<<<<
12534 : * return have_slices or nslices, tuple(result)
12535 : *
12536 : */
12537 0 : __pyx_v_nslices = (__pyx_v_ndim - __pyx_v_idx);
12538 :
12539 : /* "View.MemoryView":698
12540 : *
12541 : * nslices = ndim - idx
12542 : * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
12543 : *
12544 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
12545 : */
12546 0 : __Pyx_XDECREF(__pyx_r);
12547 0 : if (!__pyx_v_have_slices) {
12548 0 : } else {
12549 0 : __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
12550 0 : __Pyx_GOTREF(__pyx_t_7);
12551 0 : __pyx_t_1 = __pyx_t_7;
12552 0 : __pyx_t_7 = 0;
12553 0 : goto __pyx_L9_bool_binop_done;
12554 : }
12555 0 : __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
12556 : __Pyx_GOTREF(__pyx_t_7);
12557 : __pyx_t_1 = __pyx_t_7;
12558 0 : __pyx_t_7 = 0;
12559 0 : __pyx_L9_bool_binop_done:;
12560 0 : __pyx_t_7 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
12561 0 : __Pyx_GOTREF(__pyx_t_7);
12562 0 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 698, __pyx_L1_error)
12563 0 : __Pyx_GOTREF(__pyx_t_3);
12564 0 : __Pyx_GIVEREF(__pyx_t_1);
12565 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(1, 698, __pyx_L1_error);
12566 0 : __Pyx_GIVEREF(__pyx_t_7);
12567 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error);
12568 0 : __pyx_t_1 = 0;
12569 0 : __pyx_t_7 = 0;
12570 0 : __pyx_r = ((PyObject*)__pyx_t_3);
12571 0 : __pyx_t_3 = 0;
12572 0 : goto __pyx_L0;
12573 :
12574 : /* "View.MemoryView":671
12575 : * return isinstance(o, memoryview)
12576 : *
12577 : * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
12578 : * """
12579 : * Replace all ellipses with full slices and fill incomplete indices with
12580 : */
12581 :
12582 : /* function exit code */
12583 0 : __pyx_L1_error:;
12584 0 : __Pyx_XDECREF(__pyx_t_1);
12585 0 : __Pyx_XDECREF(__pyx_t_3);
12586 0 : __Pyx_XDECREF(__pyx_t_7);
12587 0 : __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
12588 0 : __pyx_r = 0;
12589 0 : __pyx_L0:;
12590 0 : __Pyx_XDECREF(__pyx_v_tup);
12591 0 : __Pyx_XDECREF(__pyx_v_result);
12592 0 : __Pyx_XDECREF(__pyx_v_item);
12593 0 : __Pyx_XGIVEREF(__pyx_r);
12594 0 : __Pyx_RefNannyFinishContext();
12595 0 : return __pyx_r;
12596 : }
12597 :
12598 : /* "View.MemoryView":700
12599 : * return have_slices or nslices, tuple(result)
12600 : *
12601 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
12602 : * for suboffset in suboffsets[:ndim]:
12603 : * if suboffset >= 0:
12604 : */
12605 :
12606 0 : static int assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
12607 0 : Py_ssize_t __pyx_v_suboffset;
12608 0 : int __pyx_r;
12609 0 : Py_ssize_t *__pyx_t_1;
12610 0 : Py_ssize_t *__pyx_t_2;
12611 0 : Py_ssize_t *__pyx_t_3;
12612 0 : int __pyx_t_4;
12613 0 : int __pyx_lineno = 0;
12614 0 : const char *__pyx_filename = NULL;
12615 0 : int __pyx_clineno = 0;
12616 :
12617 : /* "View.MemoryView":701
12618 : *
12619 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
12620 : * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
12621 : * if suboffset >= 0:
12622 : * raise ValueError, "Indirect dimensions not supported"
12623 : */
12624 0 : __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
12625 0 : for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
12626 0 : __pyx_t_1 = __pyx_t_3;
12627 0 : __pyx_v_suboffset = (__pyx_t_1[0]);
12628 :
12629 : /* "View.MemoryView":702
12630 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
12631 : * for suboffset in suboffsets[:ndim]:
12632 : * if suboffset >= 0: # <<<<<<<<<<<<<<
12633 : * raise ValueError, "Indirect dimensions not supported"
12634 : * return 0 # return type just used as an error flag
12635 : */
12636 0 : __pyx_t_4 = (__pyx_v_suboffset >= 0);
12637 0 : if (unlikely(__pyx_t_4)) {
12638 :
12639 : /* "View.MemoryView":703
12640 : * for suboffset in suboffsets[:ndim]:
12641 : * if suboffset >= 0:
12642 : * raise ValueError, "Indirect dimensions not supported" # <<<<<<<<<<<<<<
12643 : * return 0 # return type just used as an error flag
12644 : *
12645 : */
12646 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Indirect_dimensions_not_supporte, 0, 0);
12647 0 : __PYX_ERR(1, 703, __pyx_L1_error)
12648 :
12649 : /* "View.MemoryView":702
12650 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
12651 : * for suboffset in suboffsets[:ndim]:
12652 : * if suboffset >= 0: # <<<<<<<<<<<<<<
12653 : * raise ValueError, "Indirect dimensions not supported"
12654 : * return 0 # return type just used as an error flag
12655 : */
12656 : }
12657 : }
12658 :
12659 : /* "View.MemoryView":704
12660 : * if suboffset >= 0:
12661 : * raise ValueError, "Indirect dimensions not supported"
12662 : * return 0 # return type just used as an error flag # <<<<<<<<<<<<<<
12663 : *
12664 : *
12665 : */
12666 0 : __pyx_r = 0;
12667 0 : goto __pyx_L0;
12668 :
12669 : /* "View.MemoryView":700
12670 : * return have_slices or nslices, tuple(result)
12671 : *
12672 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
12673 : * for suboffset in suboffsets[:ndim]:
12674 : * if suboffset >= 0:
12675 : */
12676 :
12677 : /* function exit code */
12678 0 : __pyx_L1_error:;
12679 0 : __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
12680 0 : __pyx_r = -1;
12681 0 : __pyx_L0:;
12682 0 : return __pyx_r;
12683 : }
12684 :
12685 : /* "View.MemoryView":711
12686 : *
12687 : * @cname('__pyx_memview_slice')
12688 : * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
12689 : * cdef int new_ndim = 0, suboffset_dim = -1, dim
12690 : * cdef bint negative_step
12691 : */
12692 :
12693 0 : static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
12694 0 : int __pyx_v_new_ndim;
12695 0 : int __pyx_v_suboffset_dim;
12696 0 : int __pyx_v_dim;
12697 0 : __Pyx_memviewslice __pyx_v_src;
12698 0 : __Pyx_memviewslice __pyx_v_dst;
12699 0 : __Pyx_memviewslice *__pyx_v_p_src;
12700 0 : struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
12701 0 : __Pyx_memviewslice *__pyx_v_p_dst;
12702 0 : int *__pyx_v_p_suboffset_dim;
12703 0 : Py_ssize_t __pyx_v_start;
12704 0 : Py_ssize_t __pyx_v_stop;
12705 0 : Py_ssize_t __pyx_v_step;
12706 0 : Py_ssize_t __pyx_v_cindex;
12707 0 : int __pyx_v_have_start;
12708 0 : int __pyx_v_have_stop;
12709 0 : int __pyx_v_have_step;
12710 0 : PyObject *__pyx_v_index = NULL;
12711 0 : struct __pyx_memoryview_obj *__pyx_r = NULL;
12712 : __Pyx_RefNannyDeclarations
12713 0 : int __pyx_t_1;
12714 0 : PyObject *__pyx_t_2 = NULL;
12715 0 : struct __pyx_memoryview_obj *__pyx_t_3;
12716 0 : char *__pyx_t_4;
12717 0 : int __pyx_t_5;
12718 0 : Py_ssize_t __pyx_t_6;
12719 0 : PyObject *(*__pyx_t_7)(PyObject *);
12720 0 : PyObject *__pyx_t_8 = NULL;
12721 0 : Py_ssize_t __pyx_t_9;
12722 0 : int __pyx_t_10;
12723 0 : Py_ssize_t __pyx_t_11;
12724 0 : int __pyx_lineno = 0;
12725 0 : const char *__pyx_filename = NULL;
12726 0 : int __pyx_clineno = 0;
12727 0 : __Pyx_RefNannySetupContext("memview_slice", 1);
12728 :
12729 : /* "View.MemoryView":712
12730 : * @cname('__pyx_memview_slice')
12731 : * cdef memoryview memview_slice(memoryview memview, object indices):
12732 : * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
12733 : * cdef bint negative_step
12734 : * cdef __Pyx_memviewslice src, dst
12735 : */
12736 0 : __pyx_v_new_ndim = 0;
12737 0 : __pyx_v_suboffset_dim = -1;
12738 :
12739 : /* "View.MemoryView":719
12740 : *
12741 : *
12742 : * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
12743 : *
12744 : * cdef _memoryviewslice memviewsliceobj
12745 : */
12746 0 : (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
12747 :
12748 : /* "View.MemoryView":723
12749 : * cdef _memoryviewslice memviewsliceobj
12750 : *
12751 : * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
12752 : *
12753 : * if isinstance(memview, _memoryviewslice):
12754 : */
12755 : #ifndef CYTHON_WITHOUT_ASSERTIONS
12756 0 : if (unlikely(__pyx_assertions_enabled())) {
12757 0 : __pyx_t_1 = (__pyx_v_memview->view.ndim > 0);
12758 0 : if (unlikely(!__pyx_t_1)) {
12759 0 : __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
12760 0 : __PYX_ERR(1, 723, __pyx_L1_error)
12761 : }
12762 : }
12763 : #else
12764 : if ((1)); else __PYX_ERR(1, 723, __pyx_L1_error)
12765 : #endif
12766 :
12767 : /* "View.MemoryView":725
12768 : * assert memview.view.ndim > 0
12769 : *
12770 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
12771 : * memviewsliceobj = memview
12772 : * p_src = &memviewsliceobj.from_slice
12773 : */
12774 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
12775 0 : if (__pyx_t_1) {
12776 :
12777 : /* "View.MemoryView":726
12778 : *
12779 : * if isinstance(memview, _memoryviewslice):
12780 : * memviewsliceobj = memview # <<<<<<<<<<<<<<
12781 : * p_src = &memviewsliceobj.from_slice
12782 : * else:
12783 : */
12784 0 : if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 726, __pyx_L1_error)
12785 0 : __pyx_t_2 = ((PyObject *)__pyx_v_memview);
12786 0 : __Pyx_INCREF(__pyx_t_2);
12787 0 : __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
12788 0 : __pyx_t_2 = 0;
12789 :
12790 : /* "View.MemoryView":727
12791 : * if isinstance(memview, _memoryviewslice):
12792 : * memviewsliceobj = memview
12793 : * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
12794 : * else:
12795 : * slice_copy(memview, &src)
12796 : */
12797 0 : __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
12798 :
12799 : /* "View.MemoryView":725
12800 : * assert memview.view.ndim > 0
12801 : *
12802 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
12803 : * memviewsliceobj = memview
12804 : * p_src = &memviewsliceobj.from_slice
12805 : */
12806 0 : goto __pyx_L3;
12807 : }
12808 :
12809 : /* "View.MemoryView":729
12810 : * p_src = &memviewsliceobj.from_slice
12811 : * else:
12812 : * slice_copy(memview, &src) # <<<<<<<<<<<<<<
12813 : * p_src = &src
12814 : *
12815 : */
12816 : /*else*/ {
12817 0 : __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
12818 :
12819 : /* "View.MemoryView":730
12820 : * else:
12821 : * slice_copy(memview, &src)
12822 : * p_src = &src # <<<<<<<<<<<<<<
12823 : *
12824 : *
12825 : */
12826 0 : __pyx_v_p_src = (&__pyx_v_src);
12827 : }
12828 0 : __pyx_L3:;
12829 :
12830 : /* "View.MemoryView":736
12831 : *
12832 : *
12833 : * dst.memview = p_src.memview # <<<<<<<<<<<<<<
12834 : * dst.data = p_src.data
12835 : *
12836 : */
12837 0 : __pyx_t_3 = __pyx_v_p_src->memview;
12838 0 : __pyx_v_dst.memview = __pyx_t_3;
12839 :
12840 : /* "View.MemoryView":737
12841 : *
12842 : * dst.memview = p_src.memview
12843 : * dst.data = p_src.data # <<<<<<<<<<<<<<
12844 : *
12845 : *
12846 : */
12847 0 : __pyx_t_4 = __pyx_v_p_src->data;
12848 0 : __pyx_v_dst.data = __pyx_t_4;
12849 :
12850 : /* "View.MemoryView":742
12851 : *
12852 : *
12853 : * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
12854 : * cdef int *p_suboffset_dim = &suboffset_dim
12855 : * cdef Py_ssize_t start, stop, step, cindex
12856 : */
12857 0 : __pyx_v_p_dst = (&__pyx_v_dst);
12858 :
12859 : /* "View.MemoryView":743
12860 : *
12861 : * cdef __Pyx_memviewslice *p_dst = &dst
12862 : * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
12863 : * cdef Py_ssize_t start, stop, step, cindex
12864 : * cdef bint have_start, have_stop, have_step
12865 : */
12866 0 : __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
12867 :
12868 : /* "View.MemoryView":747
12869 : * cdef bint have_start, have_stop, have_step
12870 : *
12871 : * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
12872 : * if PyIndex_Check(index):
12873 : * cindex = index
12874 : */
12875 0 : __pyx_t_5 = 0;
12876 0 : if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
12877 0 : __pyx_t_2 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_2);
12878 0 : __pyx_t_6 = 0;
12879 0 : __pyx_t_7 = NULL;
12880 : } else {
12881 0 : __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 747, __pyx_L1_error)
12882 0 : __Pyx_GOTREF(__pyx_t_2);
12883 0 : __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 747, __pyx_L1_error)
12884 : }
12885 0 : for (;;) {
12886 0 : if (likely(!__pyx_t_7)) {
12887 0 : if (likely(PyList_CheckExact(__pyx_t_2))) {
12888 : {
12889 0 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
12890 : #if !CYTHON_ASSUME_SAFE_MACROS
12891 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
12892 : #endif
12893 0 : if (__pyx_t_6 >= __pyx_temp) break;
12894 : }
12895 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12896 0 : __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
12897 : #else
12898 : __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 747, __pyx_L1_error)
12899 : __Pyx_GOTREF(__pyx_t_8);
12900 : #endif
12901 : } else {
12902 : {
12903 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
12904 : #if !CYTHON_ASSUME_SAFE_MACROS
12905 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
12906 : #endif
12907 0 : if (__pyx_t_6 >= __pyx_temp) break;
12908 : }
12909 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12910 0 : __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
12911 : #else
12912 : __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 747, __pyx_L1_error)
12913 : __Pyx_GOTREF(__pyx_t_8);
12914 : #endif
12915 : }
12916 : } else {
12917 0 : __pyx_t_8 = __pyx_t_7(__pyx_t_2);
12918 0 : if (unlikely(!__pyx_t_8)) {
12919 0 : PyObject* exc_type = PyErr_Occurred();
12920 0 : if (exc_type) {
12921 0 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
12922 0 : else __PYX_ERR(1, 747, __pyx_L1_error)
12923 : }
12924 : break;
12925 : }
12926 0 : __Pyx_GOTREF(__pyx_t_8);
12927 : }
12928 0 : __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_8);
12929 0 : __pyx_t_8 = 0;
12930 0 : __pyx_v_dim = __pyx_t_5;
12931 0 : __pyx_t_5 = (__pyx_t_5 + 1);
12932 :
12933 : /* "View.MemoryView":748
12934 : *
12935 : * for dim, index in enumerate(indices):
12936 : * if PyIndex_Check(index): # <<<<<<<<<<<<<<
12937 : * cindex = index
12938 : * slice_memviewslice(
12939 : */
12940 0 : __pyx_t_1 = (PyIndex_Check(__pyx_v_index) != 0);
12941 0 : if (__pyx_t_1) {
12942 :
12943 : /* "View.MemoryView":749
12944 : * for dim, index in enumerate(indices):
12945 : * if PyIndex_Check(index):
12946 : * cindex = index # <<<<<<<<<<<<<<
12947 : * slice_memviewslice(
12948 : * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
12949 : */
12950 0 : __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 749, __pyx_L1_error)
12951 0 : __pyx_v_cindex = __pyx_t_9;
12952 :
12953 : /* "View.MemoryView":750
12954 : * if PyIndex_Check(index):
12955 : * cindex = index
12956 : * slice_memviewslice( # <<<<<<<<<<<<<<
12957 : * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
12958 : * dim, new_ndim, p_suboffset_dim,
12959 : */
12960 0 : __pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_cindex, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
12961 :
12962 : /* "View.MemoryView":748
12963 : *
12964 : * for dim, index in enumerate(indices):
12965 : * if PyIndex_Check(index): # <<<<<<<<<<<<<<
12966 : * cindex = index
12967 : * slice_memviewslice(
12968 : */
12969 0 : goto __pyx_L6;
12970 : }
12971 :
12972 : /* "View.MemoryView":756
12973 : * 0, 0, 0, # have_{start,stop,step}
12974 : * False)
12975 : * elif index is None: # <<<<<<<<<<<<<<
12976 : * p_dst.shape[new_ndim] = 1
12977 : * p_dst.strides[new_ndim] = 0
12978 : */
12979 0 : __pyx_t_1 = (__pyx_v_index == Py_None);
12980 0 : if (__pyx_t_1) {
12981 :
12982 : /* "View.MemoryView":757
12983 : * False)
12984 : * elif index is None:
12985 : * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
12986 : * p_dst.strides[new_ndim] = 0
12987 : * p_dst.suboffsets[new_ndim] = -1
12988 : */
12989 0 : (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
12990 :
12991 : /* "View.MemoryView":758
12992 : * elif index is None:
12993 : * p_dst.shape[new_ndim] = 1
12994 : * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
12995 : * p_dst.suboffsets[new_ndim] = -1
12996 : * new_ndim += 1
12997 : */
12998 0 : (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
12999 :
13000 : /* "View.MemoryView":759
13001 : * p_dst.shape[new_ndim] = 1
13002 : * p_dst.strides[new_ndim] = 0
13003 : * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
13004 : * new_ndim += 1
13005 : * else:
13006 : */
13007 0 : (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
13008 :
13009 : /* "View.MemoryView":760
13010 : * p_dst.strides[new_ndim] = 0
13011 : * p_dst.suboffsets[new_ndim] = -1
13012 : * new_ndim += 1 # <<<<<<<<<<<<<<
13013 : * else:
13014 : * start = index.start or 0
13015 : */
13016 0 : __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13017 :
13018 : /* "View.MemoryView":756
13019 : * 0, 0, 0, # have_{start,stop,step}
13020 : * False)
13021 : * elif index is None: # <<<<<<<<<<<<<<
13022 : * p_dst.shape[new_ndim] = 1
13023 : * p_dst.strides[new_ndim] = 0
13024 : */
13025 0 : goto __pyx_L6;
13026 : }
13027 :
13028 : /* "View.MemoryView":762
13029 : * new_ndim += 1
13030 : * else:
13031 : * start = index.start or 0 # <<<<<<<<<<<<<<
13032 : * stop = index.stop or 0
13033 : * step = index.step or 0
13034 : */
13035 : /*else*/ {
13036 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 762, __pyx_L1_error)
13037 0 : __Pyx_GOTREF(__pyx_t_8);
13038 0 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 762, __pyx_L1_error)
13039 0 : if (!__pyx_t_1) {
13040 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13041 : } else {
13042 0 : __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
13043 0 : __pyx_t_9 = __pyx_t_11;
13044 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13045 0 : goto __pyx_L7_bool_binop_done;
13046 : }
13047 : __pyx_t_9 = 0;
13048 0 : __pyx_L7_bool_binop_done:;
13049 0 : __pyx_v_start = __pyx_t_9;
13050 :
13051 : /* "View.MemoryView":763
13052 : * else:
13053 : * start = index.start or 0
13054 : * stop = index.stop or 0 # <<<<<<<<<<<<<<
13055 : * step = index.step or 0
13056 : *
13057 : */
13058 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 763, __pyx_L1_error)
13059 0 : __Pyx_GOTREF(__pyx_t_8);
13060 0 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 763, __pyx_L1_error)
13061 0 : if (!__pyx_t_1) {
13062 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13063 : } else {
13064 0 : __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 763, __pyx_L1_error)
13065 0 : __pyx_t_9 = __pyx_t_11;
13066 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13067 0 : goto __pyx_L9_bool_binop_done;
13068 : }
13069 : __pyx_t_9 = 0;
13070 0 : __pyx_L9_bool_binop_done:;
13071 0 : __pyx_v_stop = __pyx_t_9;
13072 :
13073 : /* "View.MemoryView":764
13074 : * start = index.start or 0
13075 : * stop = index.stop or 0
13076 : * step = index.step or 0 # <<<<<<<<<<<<<<
13077 : *
13078 : * have_start = index.start is not None
13079 : */
13080 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 764, __pyx_L1_error)
13081 0 : __Pyx_GOTREF(__pyx_t_8);
13082 0 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 764, __pyx_L1_error)
13083 0 : if (!__pyx_t_1) {
13084 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13085 : } else {
13086 0 : __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 764, __pyx_L1_error)
13087 0 : __pyx_t_9 = __pyx_t_11;
13088 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13089 0 : goto __pyx_L11_bool_binop_done;
13090 : }
13091 : __pyx_t_9 = 0;
13092 0 : __pyx_L11_bool_binop_done:;
13093 0 : __pyx_v_step = __pyx_t_9;
13094 :
13095 : /* "View.MemoryView":766
13096 : * step = index.step or 0
13097 : *
13098 : * have_start = index.start is not None # <<<<<<<<<<<<<<
13099 : * have_stop = index.stop is not None
13100 : * have_step = index.step is not None
13101 : */
13102 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 766, __pyx_L1_error)
13103 0 : __Pyx_GOTREF(__pyx_t_8);
13104 0 : __pyx_t_1 = (__pyx_t_8 != Py_None);
13105 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13106 0 : __pyx_v_have_start = __pyx_t_1;
13107 :
13108 : /* "View.MemoryView":767
13109 : *
13110 : * have_start = index.start is not None
13111 : * have_stop = index.stop is not None # <<<<<<<<<<<<<<
13112 : * have_step = index.step is not None
13113 : *
13114 : */
13115 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 767, __pyx_L1_error)
13116 0 : __Pyx_GOTREF(__pyx_t_8);
13117 0 : __pyx_t_1 = (__pyx_t_8 != Py_None);
13118 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13119 0 : __pyx_v_have_stop = __pyx_t_1;
13120 :
13121 : /* "View.MemoryView":768
13122 : * have_start = index.start is not None
13123 : * have_stop = index.stop is not None
13124 : * have_step = index.step is not None # <<<<<<<<<<<<<<
13125 : *
13126 : * slice_memviewslice(
13127 : */
13128 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 768, __pyx_L1_error)
13129 0 : __Pyx_GOTREF(__pyx_t_8);
13130 0 : __pyx_t_1 = (__pyx_t_8 != Py_None);
13131 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13132 0 : __pyx_v_have_step = __pyx_t_1;
13133 :
13134 : /* "View.MemoryView":770
13135 : * have_step = index.step is not None
13136 : *
13137 : * slice_memviewslice( # <<<<<<<<<<<<<<
13138 : * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13139 : * dim, new_ndim, p_suboffset_dim,
13140 : */
13141 0 : __pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 770, __pyx_L1_error)
13142 :
13143 : /* "View.MemoryView":776
13144 : * have_start, have_stop, have_step,
13145 : * True)
13146 : * new_ndim += 1 # <<<<<<<<<<<<<<
13147 : *
13148 : * if isinstance(memview, _memoryviewslice):
13149 : */
13150 0 : __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13151 : }
13152 0 : __pyx_L6:;
13153 :
13154 : /* "View.MemoryView":747
13155 : * cdef bint have_start, have_stop, have_step
13156 : *
13157 : * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
13158 : * if PyIndex_Check(index):
13159 : * cindex = index
13160 : */
13161 : }
13162 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13163 :
13164 : /* "View.MemoryView":778
13165 : * new_ndim += 1
13166 : *
13167 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13168 : * return memoryview_fromslice(dst, new_ndim,
13169 : * memviewsliceobj.to_object_func,
13170 : */
13171 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
13172 0 : if (__pyx_t_1) {
13173 :
13174 : /* "View.MemoryView":779
13175 : *
13176 : * if isinstance(memview, _memoryviewslice):
13177 : * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
13178 : * memviewsliceobj.to_object_func,
13179 : * memviewsliceobj.to_dtype_func,
13180 : */
13181 0 : __Pyx_XDECREF((PyObject *)__pyx_r);
13182 :
13183 : /* "View.MemoryView":780
13184 : * if isinstance(memview, _memoryviewslice):
13185 : * return memoryview_fromslice(dst, new_ndim,
13186 : * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
13187 : * memviewsliceobj.to_dtype_func,
13188 : * memview.dtype_is_object)
13189 : */
13190 0 : if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 780, __pyx_L1_error) }
13191 :
13192 : /* "View.MemoryView":781
13193 : * return memoryview_fromslice(dst, new_ndim,
13194 : * memviewsliceobj.to_object_func,
13195 : * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
13196 : * memview.dtype_is_object)
13197 : * else:
13198 : */
13199 0 : if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 781, __pyx_L1_error) }
13200 :
13201 : /* "View.MemoryView":779
13202 : *
13203 : * if isinstance(memview, _memoryviewslice):
13204 : * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
13205 : * memviewsliceobj.to_object_func,
13206 : * memviewsliceobj.to_dtype_func,
13207 : */
13208 0 : __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 779, __pyx_L1_error)
13209 0 : __Pyx_GOTREF(__pyx_t_2);
13210 0 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_memoryview_type))))) __PYX_ERR(1, 779, __pyx_L1_error)
13211 0 : __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
13212 0 : __pyx_t_2 = 0;
13213 0 : goto __pyx_L0;
13214 :
13215 : /* "View.MemoryView":778
13216 : * new_ndim += 1
13217 : *
13218 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13219 : * return memoryview_fromslice(dst, new_ndim,
13220 : * memviewsliceobj.to_object_func,
13221 : */
13222 : }
13223 :
13224 : /* "View.MemoryView":784
13225 : * memview.dtype_is_object)
13226 : * else:
13227 : * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
13228 : * memview.dtype_is_object)
13229 : *
13230 : */
13231 : /*else*/ {
13232 0 : __Pyx_XDECREF((PyObject *)__pyx_r);
13233 :
13234 : /* "View.MemoryView":785
13235 : * else:
13236 : * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
13237 : * memview.dtype_is_object) # <<<<<<<<<<<<<<
13238 : *
13239 : *
13240 : */
13241 0 : __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 784, __pyx_L1_error)
13242 0 : __Pyx_GOTREF(__pyx_t_2);
13243 :
13244 : /* "View.MemoryView":784
13245 : * memview.dtype_is_object)
13246 : * else:
13247 : * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
13248 : * memview.dtype_is_object)
13249 : *
13250 : */
13251 0 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_memoryview_type))))) __PYX_ERR(1, 784, __pyx_L1_error)
13252 0 : __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
13253 0 : __pyx_t_2 = 0;
13254 0 : goto __pyx_L0;
13255 : }
13256 :
13257 : /* "View.MemoryView":711
13258 : *
13259 : * @cname('__pyx_memview_slice')
13260 : * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
13261 : * cdef int new_ndim = 0, suboffset_dim = -1, dim
13262 : * cdef bint negative_step
13263 : */
13264 :
13265 : /* function exit code */
13266 0 : __pyx_L1_error:;
13267 0 : __Pyx_XDECREF(__pyx_t_2);
13268 0 : __Pyx_XDECREF(__pyx_t_8);
13269 0 : __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
13270 0 : __pyx_r = 0;
13271 0 : __pyx_L0:;
13272 0 : __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
13273 0 : __Pyx_XDECREF(__pyx_v_index);
13274 0 : __Pyx_XGIVEREF((PyObject *)__pyx_r);
13275 0 : __Pyx_RefNannyFinishContext();
13276 0 : return __pyx_r;
13277 : }
13278 :
13279 : /* "View.MemoryView":793
13280 : *
13281 : * @cname('__pyx_memoryview_slice_memviewslice')
13282 : * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
13283 : * __Pyx_memviewslice *dst,
13284 : * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
13285 : */
13286 :
13287 0 : static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
13288 0 : Py_ssize_t __pyx_v_new_shape;
13289 0 : int __pyx_v_negative_step;
13290 0 : int __pyx_r;
13291 0 : int __pyx_t_1;
13292 0 : int __pyx_t_2;
13293 0 : int __pyx_t_3;
13294 0 : int __pyx_lineno = 0;
13295 0 : const char *__pyx_filename = NULL;
13296 0 : int __pyx_clineno = 0;
13297 : #ifdef WITH_THREAD
13298 0 : PyGILState_STATE __pyx_gilstate_save;
13299 : #endif
13300 :
13301 : /* "View.MemoryView":813
13302 : * cdef bint negative_step
13303 : *
13304 : * if not is_slice: # <<<<<<<<<<<<<<
13305 : *
13306 : * if start < 0:
13307 : */
13308 0 : __pyx_t_1 = (!__pyx_v_is_slice);
13309 0 : if (__pyx_t_1) {
13310 :
13311 : /* "View.MemoryView":815
13312 : * if not is_slice:
13313 : *
13314 : * if start < 0: # <<<<<<<<<<<<<<
13315 : * start += shape
13316 : * if not 0 <= start < shape:
13317 : */
13318 0 : __pyx_t_1 = (__pyx_v_start < 0);
13319 0 : if (__pyx_t_1) {
13320 :
13321 : /* "View.MemoryView":816
13322 : *
13323 : * if start < 0:
13324 : * start += shape # <<<<<<<<<<<<<<
13325 : * if not 0 <= start < shape:
13326 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
13327 : */
13328 0 : __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
13329 :
13330 : /* "View.MemoryView":815
13331 : * if not is_slice:
13332 : *
13333 : * if start < 0: # <<<<<<<<<<<<<<
13334 : * start += shape
13335 : * if not 0 <= start < shape:
13336 : */
13337 : }
13338 :
13339 : /* "View.MemoryView":817
13340 : * if start < 0:
13341 : * start += shape
13342 : * if not 0 <= start < shape: # <<<<<<<<<<<<<<
13343 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
13344 : * else:
13345 : */
13346 0 : __pyx_t_1 = (0 <= __pyx_v_start);
13347 0 : if (__pyx_t_1) {
13348 0 : __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
13349 : }
13350 0 : __pyx_t_2 = (!__pyx_t_1);
13351 0 : if (__pyx_t_2) {
13352 :
13353 : /* "View.MemoryView":818
13354 : * start += shape
13355 : * if not 0 <= start < shape:
13356 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
13357 : * else:
13358 : *
13359 : */
13360 0 : __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_IndexError, __pyx_kp_s_Index_out_of_bounds_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 818, __pyx_L1_error)
13361 :
13362 : /* "View.MemoryView":817
13363 : * if start < 0:
13364 : * start += shape
13365 : * if not 0 <= start < shape: # <<<<<<<<<<<<<<
13366 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
13367 : * else:
13368 : */
13369 : }
13370 :
13371 : /* "View.MemoryView":813
13372 : * cdef bint negative_step
13373 : *
13374 : * if not is_slice: # <<<<<<<<<<<<<<
13375 : *
13376 : * if start < 0:
13377 : */
13378 0 : goto __pyx_L3;
13379 : }
13380 :
13381 : /* "View.MemoryView":821
13382 : * else:
13383 : *
13384 : * if have_step: # <<<<<<<<<<<<<<
13385 : * negative_step = step < 0
13386 : * if step == 0:
13387 : */
13388 : /*else*/ {
13389 0 : __pyx_t_2 = (__pyx_v_have_step != 0);
13390 0 : if (__pyx_t_2) {
13391 :
13392 : /* "View.MemoryView":822
13393 : *
13394 : * if have_step:
13395 : * negative_step = step < 0 # <<<<<<<<<<<<<<
13396 : * if step == 0:
13397 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
13398 : */
13399 0 : __pyx_v_negative_step = (__pyx_v_step < 0);
13400 :
13401 : /* "View.MemoryView":823
13402 : * if have_step:
13403 : * negative_step = step < 0
13404 : * if step == 0: # <<<<<<<<<<<<<<
13405 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
13406 : * else:
13407 : */
13408 0 : __pyx_t_2 = (__pyx_v_step == 0);
13409 0 : if (__pyx_t_2) {
13410 :
13411 : /* "View.MemoryView":824
13412 : * negative_step = step < 0
13413 : * if step == 0:
13414 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
13415 : * else:
13416 : * negative_step = False
13417 : */
13418 0 : __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_kp_s_Step_may_not_be_zero_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 824, __pyx_L1_error)
13419 :
13420 : /* "View.MemoryView":823
13421 : * if have_step:
13422 : * negative_step = step < 0
13423 : * if step == 0: # <<<<<<<<<<<<<<
13424 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
13425 : * else:
13426 : */
13427 : }
13428 :
13429 : /* "View.MemoryView":821
13430 : * else:
13431 : *
13432 : * if have_step: # <<<<<<<<<<<<<<
13433 : * negative_step = step < 0
13434 : * if step == 0:
13435 : */
13436 0 : goto __pyx_L6;
13437 : }
13438 :
13439 : /* "View.MemoryView":826
13440 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
13441 : * else:
13442 : * negative_step = False # <<<<<<<<<<<<<<
13443 : * step = 1
13444 : *
13445 : */
13446 : /*else*/ {
13447 : __pyx_v_negative_step = 0;
13448 :
13449 : /* "View.MemoryView":827
13450 : * else:
13451 : * negative_step = False
13452 : * step = 1 # <<<<<<<<<<<<<<
13453 : *
13454 : *
13455 : */
13456 : __pyx_v_step = 1;
13457 : }
13458 0 : __pyx_L6:;
13459 :
13460 : /* "View.MemoryView":830
13461 : *
13462 : *
13463 : * if have_start: # <<<<<<<<<<<<<<
13464 : * if start < 0:
13465 : * start += shape
13466 : */
13467 0 : __pyx_t_2 = (__pyx_v_have_start != 0);
13468 0 : if (__pyx_t_2) {
13469 :
13470 : /* "View.MemoryView":831
13471 : *
13472 : * if have_start:
13473 : * if start < 0: # <<<<<<<<<<<<<<
13474 : * start += shape
13475 : * if start < 0:
13476 : */
13477 0 : __pyx_t_2 = (__pyx_v_start < 0);
13478 0 : if (__pyx_t_2) {
13479 :
13480 : /* "View.MemoryView":832
13481 : * if have_start:
13482 : * if start < 0:
13483 : * start += shape # <<<<<<<<<<<<<<
13484 : * if start < 0:
13485 : * start = 0
13486 : */
13487 0 : __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
13488 :
13489 : /* "View.MemoryView":833
13490 : * if start < 0:
13491 : * start += shape
13492 : * if start < 0: # <<<<<<<<<<<<<<
13493 : * start = 0
13494 : * elif start >= shape:
13495 : */
13496 0 : __pyx_t_2 = (__pyx_v_start < 0);
13497 0 : if (__pyx_t_2) {
13498 :
13499 : /* "View.MemoryView":834
13500 : * start += shape
13501 : * if start < 0:
13502 : * start = 0 # <<<<<<<<<<<<<<
13503 : * elif start >= shape:
13504 : * if negative_step:
13505 : */
13506 : __pyx_v_start = 0;
13507 :
13508 : /* "View.MemoryView":833
13509 : * if start < 0:
13510 : * start += shape
13511 : * if start < 0: # <<<<<<<<<<<<<<
13512 : * start = 0
13513 : * elif start >= shape:
13514 : */
13515 : }
13516 :
13517 : /* "View.MemoryView":831
13518 : *
13519 : * if have_start:
13520 : * if start < 0: # <<<<<<<<<<<<<<
13521 : * start += shape
13522 : * if start < 0:
13523 : */
13524 0 : goto __pyx_L9;
13525 : }
13526 :
13527 : /* "View.MemoryView":835
13528 : * if start < 0:
13529 : * start = 0
13530 : * elif start >= shape: # <<<<<<<<<<<<<<
13531 : * if negative_step:
13532 : * start = shape - 1
13533 : */
13534 0 : __pyx_t_2 = (__pyx_v_start >= __pyx_v_shape);
13535 0 : if (__pyx_t_2) {
13536 :
13537 : /* "View.MemoryView":836
13538 : * start = 0
13539 : * elif start >= shape:
13540 : * if negative_step: # <<<<<<<<<<<<<<
13541 : * start = shape - 1
13542 : * else:
13543 : */
13544 0 : if (__pyx_v_negative_step) {
13545 :
13546 : /* "View.MemoryView":837
13547 : * elif start >= shape:
13548 : * if negative_step:
13549 : * start = shape - 1 # <<<<<<<<<<<<<<
13550 : * else:
13551 : * start = shape
13552 : */
13553 0 : __pyx_v_start = (__pyx_v_shape - 1);
13554 :
13555 : /* "View.MemoryView":836
13556 : * start = 0
13557 : * elif start >= shape:
13558 : * if negative_step: # <<<<<<<<<<<<<<
13559 : * start = shape - 1
13560 : * else:
13561 : */
13562 0 : goto __pyx_L11;
13563 : }
13564 :
13565 : /* "View.MemoryView":839
13566 : * start = shape - 1
13567 : * else:
13568 : * start = shape # <<<<<<<<<<<<<<
13569 : * else:
13570 : * if negative_step:
13571 : */
13572 : /*else*/ {
13573 : __pyx_v_start = __pyx_v_shape;
13574 : }
13575 0 : __pyx_L11:;
13576 :
13577 : /* "View.MemoryView":835
13578 : * if start < 0:
13579 : * start = 0
13580 : * elif start >= shape: # <<<<<<<<<<<<<<
13581 : * if negative_step:
13582 : * start = shape - 1
13583 : */
13584 : }
13585 0 : __pyx_L9:;
13586 :
13587 : /* "View.MemoryView":830
13588 : *
13589 : *
13590 : * if have_start: # <<<<<<<<<<<<<<
13591 : * if start < 0:
13592 : * start += shape
13593 : */
13594 0 : goto __pyx_L8;
13595 : }
13596 :
13597 : /* "View.MemoryView":841
13598 : * start = shape
13599 : * else:
13600 : * if negative_step: # <<<<<<<<<<<<<<
13601 : * start = shape - 1
13602 : * else:
13603 : */
13604 : /*else*/ {
13605 0 : if (__pyx_v_negative_step) {
13606 :
13607 : /* "View.MemoryView":842
13608 : * else:
13609 : * if negative_step:
13610 : * start = shape - 1 # <<<<<<<<<<<<<<
13611 : * else:
13612 : * start = 0
13613 : */
13614 0 : __pyx_v_start = (__pyx_v_shape - 1);
13615 :
13616 : /* "View.MemoryView":841
13617 : * start = shape
13618 : * else:
13619 : * if negative_step: # <<<<<<<<<<<<<<
13620 : * start = shape - 1
13621 : * else:
13622 : */
13623 0 : goto __pyx_L12;
13624 : }
13625 :
13626 : /* "View.MemoryView":844
13627 : * start = shape - 1
13628 : * else:
13629 : * start = 0 # <<<<<<<<<<<<<<
13630 : *
13631 : * if have_stop:
13632 : */
13633 : /*else*/ {
13634 : __pyx_v_start = 0;
13635 : }
13636 0 : __pyx_L12:;
13637 : }
13638 0 : __pyx_L8:;
13639 :
13640 : /* "View.MemoryView":846
13641 : * start = 0
13642 : *
13643 : * if have_stop: # <<<<<<<<<<<<<<
13644 : * if stop < 0:
13645 : * stop += shape
13646 : */
13647 0 : __pyx_t_2 = (__pyx_v_have_stop != 0);
13648 0 : if (__pyx_t_2) {
13649 :
13650 : /* "View.MemoryView":847
13651 : *
13652 : * if have_stop:
13653 : * if stop < 0: # <<<<<<<<<<<<<<
13654 : * stop += shape
13655 : * if stop < 0:
13656 : */
13657 0 : __pyx_t_2 = (__pyx_v_stop < 0);
13658 0 : if (__pyx_t_2) {
13659 :
13660 : /* "View.MemoryView":848
13661 : * if have_stop:
13662 : * if stop < 0:
13663 : * stop += shape # <<<<<<<<<<<<<<
13664 : * if stop < 0:
13665 : * stop = 0
13666 : */
13667 0 : __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
13668 :
13669 : /* "View.MemoryView":849
13670 : * if stop < 0:
13671 : * stop += shape
13672 : * if stop < 0: # <<<<<<<<<<<<<<
13673 : * stop = 0
13674 : * elif stop > shape:
13675 : */
13676 0 : __pyx_t_2 = (__pyx_v_stop < 0);
13677 0 : if (__pyx_t_2) {
13678 :
13679 : /* "View.MemoryView":850
13680 : * stop += shape
13681 : * if stop < 0:
13682 : * stop = 0 # <<<<<<<<<<<<<<
13683 : * elif stop > shape:
13684 : * stop = shape
13685 : */
13686 : __pyx_v_stop = 0;
13687 :
13688 : /* "View.MemoryView":849
13689 : * if stop < 0:
13690 : * stop += shape
13691 : * if stop < 0: # <<<<<<<<<<<<<<
13692 : * stop = 0
13693 : * elif stop > shape:
13694 : */
13695 : }
13696 :
13697 : /* "View.MemoryView":847
13698 : *
13699 : * if have_stop:
13700 : * if stop < 0: # <<<<<<<<<<<<<<
13701 : * stop += shape
13702 : * if stop < 0:
13703 : */
13704 0 : goto __pyx_L14;
13705 : }
13706 :
13707 : /* "View.MemoryView":851
13708 : * if stop < 0:
13709 : * stop = 0
13710 : * elif stop > shape: # <<<<<<<<<<<<<<
13711 : * stop = shape
13712 : * else:
13713 : */
13714 0 : __pyx_t_2 = (__pyx_v_stop > __pyx_v_shape);
13715 0 : if (__pyx_t_2) {
13716 :
13717 : /* "View.MemoryView":852
13718 : * stop = 0
13719 : * elif stop > shape:
13720 : * stop = shape # <<<<<<<<<<<<<<
13721 : * else:
13722 : * if negative_step:
13723 : */
13724 : __pyx_v_stop = __pyx_v_shape;
13725 :
13726 : /* "View.MemoryView":851
13727 : * if stop < 0:
13728 : * stop = 0
13729 : * elif stop > shape: # <<<<<<<<<<<<<<
13730 : * stop = shape
13731 : * else:
13732 : */
13733 : }
13734 0 : __pyx_L14:;
13735 :
13736 : /* "View.MemoryView":846
13737 : * start = 0
13738 : *
13739 : * if have_stop: # <<<<<<<<<<<<<<
13740 : * if stop < 0:
13741 : * stop += shape
13742 : */
13743 0 : goto __pyx_L13;
13744 : }
13745 :
13746 : /* "View.MemoryView":854
13747 : * stop = shape
13748 : * else:
13749 : * if negative_step: # <<<<<<<<<<<<<<
13750 : * stop = -1
13751 : * else:
13752 : */
13753 : /*else*/ {
13754 0 : if (__pyx_v_negative_step) {
13755 :
13756 : /* "View.MemoryView":855
13757 : * else:
13758 : * if negative_step:
13759 : * stop = -1 # <<<<<<<<<<<<<<
13760 : * else:
13761 : * stop = shape
13762 : */
13763 0 : __pyx_v_stop = -1L;
13764 :
13765 : /* "View.MemoryView":854
13766 : * stop = shape
13767 : * else:
13768 : * if negative_step: # <<<<<<<<<<<<<<
13769 : * stop = -1
13770 : * else:
13771 : */
13772 0 : goto __pyx_L16;
13773 : }
13774 :
13775 : /* "View.MemoryView":857
13776 : * stop = -1
13777 : * else:
13778 : * stop = shape # <<<<<<<<<<<<<<
13779 : *
13780 : *
13781 : */
13782 : /*else*/ {
13783 : __pyx_v_stop = __pyx_v_shape;
13784 : }
13785 0 : __pyx_L16:;
13786 : }
13787 0 : __pyx_L13:;
13788 :
13789 : /* "View.MemoryView":861
13790 : *
13791 : * with cython.cdivision(True):
13792 : * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
13793 : *
13794 : * if (stop - start) - step * new_shape:
13795 : */
13796 0 : __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
13797 :
13798 : /* "View.MemoryView":863
13799 : * new_shape = (stop - start) // step
13800 : *
13801 : * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
13802 : * new_shape += 1
13803 : *
13804 : */
13805 0 : __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
13806 0 : if (__pyx_t_2) {
13807 :
13808 : /* "View.MemoryView":864
13809 : *
13810 : * if (stop - start) - step * new_shape:
13811 : * new_shape += 1 # <<<<<<<<<<<<<<
13812 : *
13813 : * if new_shape < 0:
13814 : */
13815 0 : __pyx_v_new_shape = (__pyx_v_new_shape + 1);
13816 :
13817 : /* "View.MemoryView":863
13818 : * new_shape = (stop - start) // step
13819 : *
13820 : * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
13821 : * new_shape += 1
13822 : *
13823 : */
13824 : }
13825 :
13826 : /* "View.MemoryView":866
13827 : * new_shape += 1
13828 : *
13829 : * if new_shape < 0: # <<<<<<<<<<<<<<
13830 : * new_shape = 0
13831 : *
13832 : */
13833 0 : __pyx_t_2 = (__pyx_v_new_shape < 0);
13834 0 : if (__pyx_t_2) {
13835 :
13836 : /* "View.MemoryView":867
13837 : *
13838 : * if new_shape < 0:
13839 : * new_shape = 0 # <<<<<<<<<<<<<<
13840 : *
13841 : *
13842 : */
13843 : __pyx_v_new_shape = 0;
13844 :
13845 : /* "View.MemoryView":866
13846 : * new_shape += 1
13847 : *
13848 : * if new_shape < 0: # <<<<<<<<<<<<<<
13849 : * new_shape = 0
13850 : *
13851 : */
13852 : }
13853 :
13854 : /* "View.MemoryView":870
13855 : *
13856 : *
13857 : * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
13858 : * dst.shape[new_ndim] = new_shape
13859 : * dst.suboffsets[new_ndim] = suboffset
13860 : */
13861 0 : (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
13862 :
13863 : /* "View.MemoryView":871
13864 : *
13865 : * dst.strides[new_ndim] = stride * step
13866 : * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
13867 : * dst.suboffsets[new_ndim] = suboffset
13868 : *
13869 : */
13870 0 : (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
13871 :
13872 : /* "View.MemoryView":872
13873 : * dst.strides[new_ndim] = stride * step
13874 : * dst.shape[new_ndim] = new_shape
13875 : * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
13876 : *
13877 : *
13878 : */
13879 0 : (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
13880 : }
13881 0 : __pyx_L3:;
13882 :
13883 : /* "View.MemoryView":875
13884 : *
13885 : *
13886 : * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
13887 : * dst.data += start * stride
13888 : * else:
13889 : */
13890 0 : __pyx_t_2 = ((__pyx_v_suboffset_dim[0]) < 0);
13891 0 : if (__pyx_t_2) {
13892 :
13893 : /* "View.MemoryView":876
13894 : *
13895 : * if suboffset_dim[0] < 0:
13896 : * dst.data += start * stride # <<<<<<<<<<<<<<
13897 : * else:
13898 : * dst.suboffsets[suboffset_dim[0]] += start * stride
13899 : */
13900 0 : __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
13901 :
13902 : /* "View.MemoryView":875
13903 : *
13904 : *
13905 : * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
13906 : * dst.data += start * stride
13907 : * else:
13908 : */
13909 0 : goto __pyx_L19;
13910 : }
13911 :
13912 : /* "View.MemoryView":878
13913 : * dst.data += start * stride
13914 : * else:
13915 : * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
13916 : *
13917 : * if suboffset >= 0:
13918 : */
13919 : /*else*/ {
13920 0 : __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
13921 0 : (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
13922 : }
13923 0 : __pyx_L19:;
13924 :
13925 : /* "View.MemoryView":880
13926 : * dst.suboffsets[suboffset_dim[0]] += start * stride
13927 : *
13928 : * if suboffset >= 0: # <<<<<<<<<<<<<<
13929 : * if not is_slice:
13930 : * if new_ndim == 0:
13931 : */
13932 0 : __pyx_t_2 = (__pyx_v_suboffset >= 0);
13933 0 : if (__pyx_t_2) {
13934 :
13935 : /* "View.MemoryView":881
13936 : *
13937 : * if suboffset >= 0:
13938 : * if not is_slice: # <<<<<<<<<<<<<<
13939 : * if new_ndim == 0:
13940 : * dst.data = (<char **> dst.data)[0] + suboffset
13941 : */
13942 0 : __pyx_t_2 = (!__pyx_v_is_slice);
13943 0 : if (__pyx_t_2) {
13944 :
13945 : /* "View.MemoryView":882
13946 : * if suboffset >= 0:
13947 : * if not is_slice:
13948 : * if new_ndim == 0: # <<<<<<<<<<<<<<
13949 : * dst.data = (<char **> dst.data)[0] + suboffset
13950 : * else:
13951 : */
13952 0 : __pyx_t_2 = (__pyx_v_new_ndim == 0);
13953 0 : if (__pyx_t_2) {
13954 :
13955 : /* "View.MemoryView":883
13956 : * if not is_slice:
13957 : * if new_ndim == 0:
13958 : * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
13959 : * else:
13960 : * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d "
13961 : */
13962 0 : __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
13963 :
13964 : /* "View.MemoryView":882
13965 : * if suboffset >= 0:
13966 : * if not is_slice:
13967 : * if new_ndim == 0: # <<<<<<<<<<<<<<
13968 : * dst.data = (<char **> dst.data)[0] + suboffset
13969 : * else:
13970 : */
13971 0 : goto __pyx_L22;
13972 : }
13973 :
13974 : /* "View.MemoryView":885
13975 : * dst.data = (<char **> dst.data)[0] + suboffset
13976 : * else:
13977 : * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
13978 : * "must be indexed and not sliced", dim)
13979 : * else:
13980 : */
13981 : /*else*/ {
13982 :
13983 : /* "View.MemoryView":886
13984 : * else:
13985 : * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d "
13986 : * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
13987 : * else:
13988 : * suboffset_dim[0] = new_ndim
13989 : */
13990 0 : __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_IndexError, __pyx_kp_s_All_dimensions_preceding_dimensi, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 885, __pyx_L1_error)
13991 : }
13992 0 : __pyx_L22:;
13993 :
13994 : /* "View.MemoryView":881
13995 : *
13996 : * if suboffset >= 0:
13997 : * if not is_slice: # <<<<<<<<<<<<<<
13998 : * if new_ndim == 0:
13999 : * dst.data = (<char **> dst.data)[0] + suboffset
14000 : */
14001 0 : goto __pyx_L21;
14002 : }
14003 :
14004 : /* "View.MemoryView":888
14005 : * "must be indexed and not sliced", dim)
14006 : * else:
14007 : * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
14008 : *
14009 : * return 0
14010 : */
14011 : /*else*/ {
14012 0 : (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
14013 : }
14014 0 : __pyx_L21:;
14015 :
14016 : /* "View.MemoryView":880
14017 : * dst.suboffsets[suboffset_dim[0]] += start * stride
14018 : *
14019 : * if suboffset >= 0: # <<<<<<<<<<<<<<
14020 : * if not is_slice:
14021 : * if new_ndim == 0:
14022 : */
14023 : }
14024 :
14025 : /* "View.MemoryView":890
14026 : * suboffset_dim[0] = new_ndim
14027 : *
14028 : * return 0 # <<<<<<<<<<<<<<
14029 : *
14030 : *
14031 : */
14032 0 : __pyx_r = 0;
14033 0 : goto __pyx_L0;
14034 :
14035 : /* "View.MemoryView":793
14036 : *
14037 : * @cname('__pyx_memoryview_slice_memviewslice')
14038 : * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
14039 : * __Pyx_memviewslice *dst,
14040 : * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
14041 : */
14042 :
14043 : /* function exit code */
14044 0 : __pyx_L1_error:;
14045 : #ifdef WITH_THREAD
14046 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14047 : #endif
14048 0 : __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14049 0 : __pyx_r = -1;
14050 : #ifdef WITH_THREAD
14051 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
14052 : #endif
14053 0 : __pyx_L0:;
14054 0 : return __pyx_r;
14055 : }
14056 :
14057 : /* "View.MemoryView":896
14058 : *
14059 : * @cname('__pyx_pybuffer_index')
14060 : * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
14061 : * Py_ssize_t dim) except NULL:
14062 : * cdef Py_ssize_t shape, stride, suboffset = -1
14063 : */
14064 :
14065 0 : static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
14066 0 : Py_ssize_t __pyx_v_shape;
14067 0 : Py_ssize_t __pyx_v_stride;
14068 0 : Py_ssize_t __pyx_v_suboffset;
14069 0 : Py_ssize_t __pyx_v_itemsize;
14070 0 : char *__pyx_v_resultp;
14071 0 : char *__pyx_r;
14072 : __Pyx_RefNannyDeclarations
14073 0 : Py_ssize_t __pyx_t_1;
14074 0 : int __pyx_t_2;
14075 0 : PyObject *__pyx_t_3 = NULL;
14076 0 : Py_UCS4 __pyx_t_4;
14077 0 : PyObject *__pyx_t_5 = NULL;
14078 0 : int __pyx_lineno = 0;
14079 0 : const char *__pyx_filename = NULL;
14080 0 : int __pyx_clineno = 0;
14081 0 : __Pyx_RefNannySetupContext("pybuffer_index", 1);
14082 :
14083 : /* "View.MemoryView":898
14084 : * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
14085 : * Py_ssize_t dim) except NULL:
14086 : * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
14087 : * cdef Py_ssize_t itemsize = view.itemsize
14088 : * cdef char *resultp
14089 : */
14090 0 : __pyx_v_suboffset = -1L;
14091 :
14092 : /* "View.MemoryView":899
14093 : * Py_ssize_t dim) except NULL:
14094 : * cdef Py_ssize_t shape, stride, suboffset = -1
14095 : * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
14096 : * cdef char *resultp
14097 : *
14098 : */
14099 0 : __pyx_t_1 = __pyx_v_view->itemsize;
14100 0 : __pyx_v_itemsize = __pyx_t_1;
14101 :
14102 : /* "View.MemoryView":902
14103 : * cdef char *resultp
14104 : *
14105 : * if view.ndim == 0: # <<<<<<<<<<<<<<
14106 : * shape = view.len // itemsize
14107 : * stride = itemsize
14108 : */
14109 0 : __pyx_t_2 = (__pyx_v_view->ndim == 0);
14110 0 : if (__pyx_t_2) {
14111 :
14112 : /* "View.MemoryView":903
14113 : *
14114 : * if view.ndim == 0:
14115 : * shape = view.len // itemsize # <<<<<<<<<<<<<<
14116 : * stride = itemsize
14117 : * else:
14118 : */
14119 0 : if (unlikely(__pyx_v_itemsize == 0)) {
14120 0 : PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
14121 0 : __PYX_ERR(1, 903, __pyx_L1_error)
14122 : }
14123 0 : else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
14124 0 : PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
14125 0 : __PYX_ERR(1, 903, __pyx_L1_error)
14126 : }
14127 0 : __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
14128 :
14129 : /* "View.MemoryView":904
14130 : * if view.ndim == 0:
14131 : * shape = view.len // itemsize
14132 : * stride = itemsize # <<<<<<<<<<<<<<
14133 : * else:
14134 : * shape = view.shape[dim]
14135 : */
14136 0 : __pyx_v_stride = __pyx_v_itemsize;
14137 :
14138 : /* "View.MemoryView":902
14139 : * cdef char *resultp
14140 : *
14141 : * if view.ndim == 0: # <<<<<<<<<<<<<<
14142 : * shape = view.len // itemsize
14143 : * stride = itemsize
14144 : */
14145 0 : goto __pyx_L3;
14146 : }
14147 :
14148 : /* "View.MemoryView":906
14149 : * stride = itemsize
14150 : * else:
14151 : * shape = view.shape[dim] # <<<<<<<<<<<<<<
14152 : * stride = view.strides[dim]
14153 : * if view.suboffsets != NULL:
14154 : */
14155 : /*else*/ {
14156 0 : __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
14157 :
14158 : /* "View.MemoryView":907
14159 : * else:
14160 : * shape = view.shape[dim]
14161 : * stride = view.strides[dim] # <<<<<<<<<<<<<<
14162 : * if view.suboffsets != NULL:
14163 : * suboffset = view.suboffsets[dim]
14164 : */
14165 0 : __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
14166 :
14167 : /* "View.MemoryView":908
14168 : * shape = view.shape[dim]
14169 : * stride = view.strides[dim]
14170 : * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
14171 : * suboffset = view.suboffsets[dim]
14172 : *
14173 : */
14174 0 : __pyx_t_2 = (__pyx_v_view->suboffsets != NULL);
14175 0 : if (__pyx_t_2) {
14176 :
14177 : /* "View.MemoryView":909
14178 : * stride = view.strides[dim]
14179 : * if view.suboffsets != NULL:
14180 : * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
14181 : *
14182 : * if index < 0:
14183 : */
14184 0 : __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
14185 :
14186 : /* "View.MemoryView":908
14187 : * shape = view.shape[dim]
14188 : * stride = view.strides[dim]
14189 : * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
14190 : * suboffset = view.suboffsets[dim]
14191 : *
14192 : */
14193 : }
14194 : }
14195 0 : __pyx_L3:;
14196 :
14197 : /* "View.MemoryView":911
14198 : * suboffset = view.suboffsets[dim]
14199 : *
14200 : * if index < 0: # <<<<<<<<<<<<<<
14201 : * index += view.shape[dim]
14202 : * if index < 0:
14203 : */
14204 0 : __pyx_t_2 = (__pyx_v_index < 0);
14205 0 : if (__pyx_t_2) {
14206 :
14207 : /* "View.MemoryView":912
14208 : *
14209 : * if index < 0:
14210 : * index += view.shape[dim] # <<<<<<<<<<<<<<
14211 : * if index < 0:
14212 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14213 : */
14214 0 : __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
14215 :
14216 : /* "View.MemoryView":913
14217 : * if index < 0:
14218 : * index += view.shape[dim]
14219 : * if index < 0: # <<<<<<<<<<<<<<
14220 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14221 : *
14222 : */
14223 0 : __pyx_t_2 = (__pyx_v_index < 0);
14224 0 : if (unlikely(__pyx_t_2)) {
14225 :
14226 : /* "View.MemoryView":914
14227 : * index += view.shape[dim]
14228 : * if index < 0:
14229 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})" # <<<<<<<<<<<<<<
14230 : *
14231 : * if index >= shape:
14232 : */
14233 0 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error)
14234 0 : __Pyx_GOTREF(__pyx_t_3);
14235 0 : __pyx_t_1 = 0;
14236 0 : __pyx_t_4 = 127;
14237 0 : __Pyx_INCREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14238 0 : __pyx_t_1 += 37;
14239 0 : __Pyx_GIVEREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14240 0 : PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14241 0 : __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 914, __pyx_L1_error)
14242 0 : __Pyx_GOTREF(__pyx_t_5);
14243 0 : __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
14244 0 : __Pyx_GIVEREF(__pyx_t_5);
14245 0 : PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
14246 0 : __pyx_t_5 = 0;
14247 0 : __Pyx_INCREF(__pyx_kp_u__7);
14248 0 : __pyx_t_1 += 1;
14249 0 : __Pyx_GIVEREF(__pyx_kp_u__7);
14250 0 : PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__7);
14251 0 : __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 914, __pyx_L1_error)
14252 0 : __Pyx_GOTREF(__pyx_t_5);
14253 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14254 0 : __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_5, 0, 0);
14255 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14256 0 : __PYX_ERR(1, 914, __pyx_L1_error)
14257 :
14258 : /* "View.MemoryView":913
14259 : * if index < 0:
14260 : * index += view.shape[dim]
14261 : * if index < 0: # <<<<<<<<<<<<<<
14262 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14263 : *
14264 : */
14265 : }
14266 :
14267 : /* "View.MemoryView":911
14268 : * suboffset = view.suboffsets[dim]
14269 : *
14270 : * if index < 0: # <<<<<<<<<<<<<<
14271 : * index += view.shape[dim]
14272 : * if index < 0:
14273 : */
14274 : }
14275 :
14276 : /* "View.MemoryView":916
14277 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14278 : *
14279 : * if index >= shape: # <<<<<<<<<<<<<<
14280 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14281 : *
14282 : */
14283 0 : __pyx_t_2 = (__pyx_v_index >= __pyx_v_shape);
14284 0 : if (unlikely(__pyx_t_2)) {
14285 :
14286 : /* "View.MemoryView":917
14287 : *
14288 : * if index >= shape:
14289 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})" # <<<<<<<<<<<<<<
14290 : *
14291 : * resultp = bufp + index * stride
14292 : */
14293 0 : __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 917, __pyx_L1_error)
14294 0 : __Pyx_GOTREF(__pyx_t_5);
14295 0 : __pyx_t_1 = 0;
14296 0 : __pyx_t_4 = 127;
14297 0 : __Pyx_INCREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14298 0 : __pyx_t_1 += 37;
14299 0 : __Pyx_GIVEREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14300 0 : PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14301 0 : __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error)
14302 0 : __Pyx_GOTREF(__pyx_t_3);
14303 0 : __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
14304 0 : __Pyx_GIVEREF(__pyx_t_3);
14305 0 : PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
14306 0 : __pyx_t_3 = 0;
14307 0 : __Pyx_INCREF(__pyx_kp_u__7);
14308 0 : __pyx_t_1 += 1;
14309 0 : __Pyx_GIVEREF(__pyx_kp_u__7);
14310 0 : PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u__7);
14311 0 : __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error)
14312 0 : __Pyx_GOTREF(__pyx_t_3);
14313 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14314 0 : __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_3, 0, 0);
14315 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14316 0 : __PYX_ERR(1, 917, __pyx_L1_error)
14317 :
14318 : /* "View.MemoryView":916
14319 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14320 : *
14321 : * if index >= shape: # <<<<<<<<<<<<<<
14322 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14323 : *
14324 : */
14325 : }
14326 :
14327 : /* "View.MemoryView":919
14328 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14329 : *
14330 : * resultp = bufp + index * stride # <<<<<<<<<<<<<<
14331 : * if suboffset >= 0:
14332 : * resultp = (<char **> resultp)[0] + suboffset
14333 : */
14334 0 : __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
14335 :
14336 : /* "View.MemoryView":920
14337 : *
14338 : * resultp = bufp + index * stride
14339 : * if suboffset >= 0: # <<<<<<<<<<<<<<
14340 : * resultp = (<char **> resultp)[0] + suboffset
14341 : *
14342 : */
14343 0 : __pyx_t_2 = (__pyx_v_suboffset >= 0);
14344 0 : if (__pyx_t_2) {
14345 :
14346 : /* "View.MemoryView":921
14347 : * resultp = bufp + index * stride
14348 : * if suboffset >= 0:
14349 : * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
14350 : *
14351 : * return resultp
14352 : */
14353 0 : __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
14354 :
14355 : /* "View.MemoryView":920
14356 : *
14357 : * resultp = bufp + index * stride
14358 : * if suboffset >= 0: # <<<<<<<<<<<<<<
14359 : * resultp = (<char **> resultp)[0] + suboffset
14360 : *
14361 : */
14362 : }
14363 :
14364 : /* "View.MemoryView":923
14365 : * resultp = (<char **> resultp)[0] + suboffset
14366 : *
14367 : * return resultp # <<<<<<<<<<<<<<
14368 : *
14369 : *
14370 : */
14371 0 : __pyx_r = __pyx_v_resultp;
14372 0 : goto __pyx_L0;
14373 :
14374 : /* "View.MemoryView":896
14375 : *
14376 : * @cname('__pyx_pybuffer_index')
14377 : * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
14378 : * Py_ssize_t dim) except NULL:
14379 : * cdef Py_ssize_t shape, stride, suboffset = -1
14380 : */
14381 :
14382 : /* function exit code */
14383 0 : __pyx_L1_error:;
14384 0 : __Pyx_XDECREF(__pyx_t_3);
14385 0 : __Pyx_XDECREF(__pyx_t_5);
14386 0 : __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
14387 0 : __pyx_r = NULL;
14388 0 : __pyx_L0:;
14389 0 : __Pyx_RefNannyFinishContext();
14390 0 : return __pyx_r;
14391 : }
14392 :
14393 : /* "View.MemoryView":929
14394 : *
14395 : * @cname('__pyx_memslice_transpose')
14396 : * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil: # <<<<<<<<<<<<<<
14397 : * cdef int ndim = memslice.memview.view.ndim
14398 : *
14399 : */
14400 :
14401 0 : static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
14402 0 : int __pyx_v_ndim;
14403 0 : Py_ssize_t *__pyx_v_shape;
14404 0 : Py_ssize_t *__pyx_v_strides;
14405 0 : int __pyx_v_i;
14406 0 : int __pyx_v_j;
14407 0 : int __pyx_r;
14408 0 : int __pyx_t_1;
14409 0 : Py_ssize_t *__pyx_t_2;
14410 0 : long __pyx_t_3;
14411 0 : long __pyx_t_4;
14412 0 : Py_ssize_t __pyx_t_5;
14413 0 : Py_ssize_t __pyx_t_6;
14414 0 : int __pyx_t_7;
14415 0 : int __pyx_t_8;
14416 0 : int __pyx_t_9;
14417 0 : int __pyx_lineno = 0;
14418 0 : const char *__pyx_filename = NULL;
14419 0 : int __pyx_clineno = 0;
14420 : #ifdef WITH_THREAD
14421 0 : PyGILState_STATE __pyx_gilstate_save;
14422 : #endif
14423 :
14424 : /* "View.MemoryView":930
14425 : * @cname('__pyx_memslice_transpose')
14426 : * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
14427 : * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
14428 : *
14429 : * cdef Py_ssize_t *shape = memslice.shape
14430 : */
14431 0 : __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
14432 0 : __pyx_v_ndim = __pyx_t_1;
14433 :
14434 : /* "View.MemoryView":932
14435 : * cdef int ndim = memslice.memview.view.ndim
14436 : *
14437 : * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
14438 : * cdef Py_ssize_t *strides = memslice.strides
14439 : *
14440 : */
14441 0 : __pyx_t_2 = __pyx_v_memslice->shape;
14442 0 : __pyx_v_shape = __pyx_t_2;
14443 :
14444 : /* "View.MemoryView":933
14445 : *
14446 : * cdef Py_ssize_t *shape = memslice.shape
14447 : * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
14448 : *
14449 : *
14450 : */
14451 0 : __pyx_t_2 = __pyx_v_memslice->strides;
14452 0 : __pyx_v_strides = __pyx_t_2;
14453 :
14454 : /* "View.MemoryView":937
14455 : *
14456 : * cdef int i, j
14457 : * for i in range(ndim // 2): # <<<<<<<<<<<<<<
14458 : * j = ndim - 1 - i
14459 : * strides[i], strides[j] = strides[j], strides[i]
14460 : */
14461 0 : __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
14462 0 : __pyx_t_4 = __pyx_t_3;
14463 0 : for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
14464 0 : __pyx_v_i = __pyx_t_1;
14465 :
14466 : /* "View.MemoryView":938
14467 : * cdef int i, j
14468 : * for i in range(ndim // 2):
14469 : * j = ndim - 1 - i # <<<<<<<<<<<<<<
14470 : * strides[i], strides[j] = strides[j], strides[i]
14471 : * shape[i], shape[j] = shape[j], shape[i]
14472 : */
14473 0 : __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
14474 :
14475 : /* "View.MemoryView":939
14476 : * for i in range(ndim // 2):
14477 : * j = ndim - 1 - i
14478 : * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
14479 : * shape[i], shape[j] = shape[j], shape[i]
14480 : *
14481 : */
14482 0 : __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
14483 0 : __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
14484 0 : (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
14485 0 : (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
14486 :
14487 : /* "View.MemoryView":940
14488 : * j = ndim - 1 - i
14489 : * strides[i], strides[j] = strides[j], strides[i]
14490 : * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
14491 : *
14492 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
14493 : */
14494 0 : __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
14495 0 : __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
14496 0 : (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
14497 0 : (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
14498 :
14499 : /* "View.MemoryView":942
14500 : * shape[i], shape[j] = shape[j], shape[i]
14501 : *
14502 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
14503 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14504 : *
14505 : */
14506 0 : __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0);
14507 0 : if (!__pyx_t_8) {
14508 0 : } else {
14509 0 : __pyx_t_7 = __pyx_t_8;
14510 0 : goto __pyx_L6_bool_binop_done;
14511 : }
14512 0 : __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0);
14513 0 : __pyx_t_7 = __pyx_t_8;
14514 0 : __pyx_L6_bool_binop_done:;
14515 0 : if (__pyx_t_7) {
14516 :
14517 : /* "View.MemoryView":943
14518 : *
14519 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
14520 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
14521 : *
14522 : * return 0
14523 : */
14524 0 : __pyx_t_9 = __pyx_memoryview_err(PyExc_ValueError, __pyx_kp_s_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 943, __pyx_L1_error)
14525 :
14526 : /* "View.MemoryView":942
14527 : * shape[i], shape[j] = shape[j], shape[i]
14528 : *
14529 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
14530 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14531 : *
14532 : */
14533 : }
14534 : }
14535 :
14536 : /* "View.MemoryView":945
14537 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14538 : *
14539 : * return 0 # <<<<<<<<<<<<<<
14540 : *
14541 : *
14542 : */
14543 0 : __pyx_r = 0;
14544 0 : goto __pyx_L0;
14545 :
14546 : /* "View.MemoryView":929
14547 : *
14548 : * @cname('__pyx_memslice_transpose')
14549 : * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil: # <<<<<<<<<<<<<<
14550 : * cdef int ndim = memslice.memview.view.ndim
14551 : *
14552 : */
14553 :
14554 : /* function exit code */
14555 0 : __pyx_L1_error:;
14556 : #ifdef WITH_THREAD
14557 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14558 : #endif
14559 0 : __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14560 0 : __pyx_r = -1;
14561 : #ifdef WITH_THREAD
14562 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
14563 : #endif
14564 0 : __pyx_L0:;
14565 0 : return __pyx_r;
14566 : }
14567 :
14568 : /* "View.MemoryView":963
14569 : * cdef int (*to_dtype_func)(char *, object) except 0
14570 : *
14571 : * def __dealloc__(self): # <<<<<<<<<<<<<<
14572 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14573 : *
14574 : */
14575 :
14576 : /* Python wrapper */
14577 : static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
14578 0 : static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
14579 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14580 : __Pyx_RefNannyDeclarations
14581 0 : __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
14582 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
14583 0 : __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14584 :
14585 : /* function exit code */
14586 0 : __Pyx_RefNannyFinishContext();
14587 : }
14588 :
14589 0 : static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14590 :
14591 : /* "View.MemoryView":964
14592 : *
14593 : * def __dealloc__(self):
14594 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
14595 : *
14596 : * cdef convert_item_to_object(self, char *itemp):
14597 : */
14598 0 : __PYX_XCLEAR_MEMVIEW((&__pyx_v_self->from_slice), 1);
14599 :
14600 : /* "View.MemoryView":963
14601 : * cdef int (*to_dtype_func)(char *, object) except 0
14602 : *
14603 : * def __dealloc__(self): # <<<<<<<<<<<<<<
14604 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14605 : *
14606 : */
14607 :
14608 : /* function exit code */
14609 : }
14610 :
14611 : /* "View.MemoryView":966
14612 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14613 : *
14614 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
14615 : * if self.to_object_func != NULL:
14616 : * return self.to_object_func(itemp)
14617 : */
14618 :
14619 0 : static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
14620 0 : PyObject *__pyx_r = NULL;
14621 : __Pyx_RefNannyDeclarations
14622 0 : int __pyx_t_1;
14623 0 : PyObject *__pyx_t_2 = NULL;
14624 0 : int __pyx_lineno = 0;
14625 0 : const char *__pyx_filename = NULL;
14626 0 : int __pyx_clineno = 0;
14627 0 : __Pyx_RefNannySetupContext("convert_item_to_object", 1);
14628 :
14629 : /* "View.MemoryView":967
14630 : *
14631 : * cdef convert_item_to_object(self, char *itemp):
14632 : * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
14633 : * return self.to_object_func(itemp)
14634 : * else:
14635 : */
14636 0 : __pyx_t_1 = (__pyx_v_self->to_object_func != NULL);
14637 0 : if (__pyx_t_1) {
14638 :
14639 : /* "View.MemoryView":968
14640 : * cdef convert_item_to_object(self, char *itemp):
14641 : * if self.to_object_func != NULL:
14642 : * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
14643 : * else:
14644 : * return memoryview.convert_item_to_object(self, itemp)
14645 : */
14646 0 : __Pyx_XDECREF(__pyx_r);
14647 0 : __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 968, __pyx_L1_error)
14648 0 : __Pyx_GOTREF(__pyx_t_2);
14649 0 : __pyx_r = __pyx_t_2;
14650 0 : __pyx_t_2 = 0;
14651 0 : goto __pyx_L0;
14652 :
14653 : /* "View.MemoryView":967
14654 : *
14655 : * cdef convert_item_to_object(self, char *itemp):
14656 : * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
14657 : * return self.to_object_func(itemp)
14658 : * else:
14659 : */
14660 : }
14661 :
14662 : /* "View.MemoryView":970
14663 : * return self.to_object_func(itemp)
14664 : * else:
14665 : * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
14666 : *
14667 : * cdef assign_item_from_object(self, char *itemp, object value):
14668 : */
14669 : /*else*/ {
14670 0 : __Pyx_XDECREF(__pyx_r);
14671 0 : __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 970, __pyx_L1_error)
14672 0 : __Pyx_GOTREF(__pyx_t_2);
14673 0 : __pyx_r = __pyx_t_2;
14674 0 : __pyx_t_2 = 0;
14675 0 : goto __pyx_L0;
14676 : }
14677 :
14678 : /* "View.MemoryView":966
14679 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14680 : *
14681 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
14682 : * if self.to_object_func != NULL:
14683 : * return self.to_object_func(itemp)
14684 : */
14685 :
14686 : /* function exit code */
14687 0 : __pyx_L1_error:;
14688 0 : __Pyx_XDECREF(__pyx_t_2);
14689 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14690 0 : __pyx_r = 0;
14691 0 : __pyx_L0:;
14692 0 : __Pyx_XGIVEREF(__pyx_r);
14693 0 : __Pyx_RefNannyFinishContext();
14694 0 : return __pyx_r;
14695 : }
14696 :
14697 : /* "View.MemoryView":972
14698 : * return memoryview.convert_item_to_object(self, itemp)
14699 : *
14700 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
14701 : * if self.to_dtype_func != NULL:
14702 : * self.to_dtype_func(itemp, value)
14703 : */
14704 :
14705 0 : static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
14706 0 : PyObject *__pyx_r = NULL;
14707 : __Pyx_RefNannyDeclarations
14708 0 : int __pyx_t_1;
14709 0 : int __pyx_t_2;
14710 0 : PyObject *__pyx_t_3 = NULL;
14711 0 : int __pyx_lineno = 0;
14712 0 : const char *__pyx_filename = NULL;
14713 0 : int __pyx_clineno = 0;
14714 0 : __Pyx_RefNannySetupContext("assign_item_from_object", 1);
14715 :
14716 : /* "View.MemoryView":973
14717 : *
14718 : * cdef assign_item_from_object(self, char *itemp, object value):
14719 : * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
14720 : * self.to_dtype_func(itemp, value)
14721 : * else:
14722 : */
14723 0 : __pyx_t_1 = (__pyx_v_self->to_dtype_func != NULL);
14724 0 : if (__pyx_t_1) {
14725 :
14726 : /* "View.MemoryView":974
14727 : * cdef assign_item_from_object(self, char *itemp, object value):
14728 : * if self.to_dtype_func != NULL:
14729 : * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
14730 : * else:
14731 : * memoryview.assign_item_from_object(self, itemp, value)
14732 : */
14733 0 : __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 974, __pyx_L1_error)
14734 :
14735 : /* "View.MemoryView":973
14736 : *
14737 : * cdef assign_item_from_object(self, char *itemp, object value):
14738 : * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
14739 : * self.to_dtype_func(itemp, value)
14740 : * else:
14741 : */
14742 0 : goto __pyx_L3;
14743 : }
14744 :
14745 : /* "View.MemoryView":976
14746 : * self.to_dtype_func(itemp, value)
14747 : * else:
14748 : * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
14749 : *
14750 : * cdef _get_base(self):
14751 : */
14752 : /*else*/ {
14753 0 : __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 976, __pyx_L1_error)
14754 0 : __Pyx_GOTREF(__pyx_t_3);
14755 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14756 : }
14757 0 : __pyx_L3:;
14758 :
14759 : /* "View.MemoryView":972
14760 : * return memoryview.convert_item_to_object(self, itemp)
14761 : *
14762 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
14763 : * if self.to_dtype_func != NULL:
14764 : * self.to_dtype_func(itemp, value)
14765 : */
14766 :
14767 : /* function exit code */
14768 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14769 0 : goto __pyx_L0;
14770 0 : __pyx_L1_error:;
14771 0 : __Pyx_XDECREF(__pyx_t_3);
14772 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14773 0 : __pyx_r = 0;
14774 0 : __pyx_L0:;
14775 0 : __Pyx_XGIVEREF(__pyx_r);
14776 0 : __Pyx_RefNannyFinishContext();
14777 0 : return __pyx_r;
14778 : }
14779 :
14780 : /* "View.MemoryView":978
14781 : * memoryview.assign_item_from_object(self, itemp, value)
14782 : *
14783 : * cdef _get_base(self): # <<<<<<<<<<<<<<
14784 : * return self.from_object
14785 : *
14786 : */
14787 :
14788 0 : static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14789 0 : PyObject *__pyx_r = NULL;
14790 : __Pyx_RefNannyDeclarations
14791 0 : __Pyx_RefNannySetupContext("_get_base", 1);
14792 :
14793 : /* "View.MemoryView":979
14794 : *
14795 : * cdef _get_base(self):
14796 : * return self.from_object # <<<<<<<<<<<<<<
14797 : *
14798 : *
14799 : */
14800 0 : __Pyx_XDECREF(__pyx_r);
14801 0 : __Pyx_INCREF(__pyx_v_self->from_object);
14802 0 : __pyx_r = __pyx_v_self->from_object;
14803 0 : goto __pyx_L0;
14804 :
14805 : /* "View.MemoryView":978
14806 : * memoryview.assign_item_from_object(self, itemp, value)
14807 : *
14808 : * cdef _get_base(self): # <<<<<<<<<<<<<<
14809 : * return self.from_object
14810 : *
14811 : */
14812 :
14813 : /* function exit code */
14814 0 : __pyx_L0:;
14815 0 : __Pyx_XGIVEREF(__pyx_r);
14816 0 : __Pyx_RefNannyFinishContext();
14817 0 : return __pyx_r;
14818 : }
14819 :
14820 : /* "(tree fragment)":1
14821 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14822 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14823 : * def __setstate_cython__(self, __pyx_state):
14824 : */
14825 :
14826 : /* Python wrapper */
14827 : static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
14828 : #if CYTHON_METH_FASTCALL
14829 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14830 : #else
14831 : PyObject *__pyx_args, PyObject *__pyx_kwds
14832 : #endif
14833 : ); /*proto*/
14834 0 : static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
14835 : #if CYTHON_METH_FASTCALL
14836 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14837 : #else
14838 : PyObject *__pyx_args, PyObject *__pyx_kwds
14839 : #endif
14840 : ) {
14841 : #if !CYTHON_METH_FASTCALL
14842 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
14843 : #endif
14844 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14845 0 : PyObject *__pyx_r = 0;
14846 : __Pyx_RefNannyDeclarations
14847 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14848 : #if !CYTHON_METH_FASTCALL
14849 : #if CYTHON_ASSUME_SAFE_MACROS
14850 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
14851 : #else
14852 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
14853 : #endif
14854 : #endif
14855 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
14856 0 : if (unlikely(__pyx_nargs > 0)) {
14857 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
14858 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
14859 0 : __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14860 :
14861 : /* function exit code */
14862 0 : __Pyx_RefNannyFinishContext();
14863 0 : return __pyx_r;
14864 : }
14865 :
14866 0 : static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14867 0 : PyObject *__pyx_r = NULL;
14868 : __Pyx_RefNannyDeclarations
14869 0 : int __pyx_lineno = 0;
14870 0 : const char *__pyx_filename = NULL;
14871 0 : int __pyx_clineno = 0;
14872 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
14873 :
14874 : /* "(tree fragment)":2
14875 : * def __reduce_cython__(self):
14876 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
14877 : * def __setstate_cython__(self, __pyx_state):
14878 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14879 : */
14880 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
14881 0 : __PYX_ERR(1, 2, __pyx_L1_error)
14882 :
14883 : /* "(tree fragment)":1
14884 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14885 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14886 : * def __setstate_cython__(self, __pyx_state):
14887 : */
14888 :
14889 : /* function exit code */
14890 0 : __pyx_L1_error:;
14891 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14892 0 : __pyx_r = NULL;
14893 0 : __Pyx_XGIVEREF(__pyx_r);
14894 0 : __Pyx_RefNannyFinishContext();
14895 0 : return __pyx_r;
14896 : }
14897 :
14898 : /* "(tree fragment)":3
14899 : * def __reduce_cython__(self):
14900 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14901 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14902 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14903 : */
14904 :
14905 : /* Python wrapper */
14906 : static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
14907 : #if CYTHON_METH_FASTCALL
14908 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14909 : #else
14910 : PyObject *__pyx_args, PyObject *__pyx_kwds
14911 : #endif
14912 : ); /*proto*/
14913 0 : static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
14914 : #if CYTHON_METH_FASTCALL
14915 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14916 : #else
14917 : PyObject *__pyx_args, PyObject *__pyx_kwds
14918 : #endif
14919 : ) {
14920 0 : CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
14921 : #if !CYTHON_METH_FASTCALL
14922 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
14923 : #endif
14924 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14925 0 : PyObject* values[1] = {0};
14926 0 : int __pyx_lineno = 0;
14927 0 : const char *__pyx_filename = NULL;
14928 0 : int __pyx_clineno = 0;
14929 0 : PyObject *__pyx_r = 0;
14930 : __Pyx_RefNannyDeclarations
14931 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14932 : #if !CYTHON_METH_FASTCALL
14933 : #if CYTHON_ASSUME_SAFE_MACROS
14934 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
14935 : #else
14936 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
14937 : #endif
14938 : #endif
14939 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
14940 : {
14941 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
14942 0 : if (__pyx_kwds) {
14943 0 : Py_ssize_t kw_args;
14944 0 : switch (__pyx_nargs) {
14945 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
14946 0 : CYTHON_FALLTHROUGH;
14947 0 : case 0: break;
14948 0 : default: goto __pyx_L5_argtuple_error;
14949 : }
14950 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
14951 0 : switch (__pyx_nargs) {
14952 : case 0:
14953 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
14954 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
14955 0 : kw_args--;
14956 : }
14957 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
14958 0 : else goto __pyx_L5_argtuple_error;
14959 : }
14960 0 : if (unlikely(kw_args > 0)) {
14961 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
14962 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
14963 : }
14964 0 : } else if (unlikely(__pyx_nargs != 1)) {
14965 0 : goto __pyx_L5_argtuple_error;
14966 : } else {
14967 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
14968 : }
14969 0 : __pyx_v___pyx_state = values[0];
14970 : }
14971 0 : goto __pyx_L6_skip;
14972 0 : __pyx_L5_argtuple_error:;
14973 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
14974 0 : __pyx_L6_skip:;
14975 0 : goto __pyx_L4_argument_unpacking_done;
14976 0 : __pyx_L3_error:;
14977 : {
14978 0 : Py_ssize_t __pyx_temp;
14979 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
14980 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
14981 : }
14982 : }
14983 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14984 0 : __Pyx_RefNannyFinishContext();
14985 0 : return NULL;
14986 0 : __pyx_L4_argument_unpacking_done:;
14987 0 : __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), __pyx_v___pyx_state);
14988 :
14989 : /* function exit code */
14990 : {
14991 0 : Py_ssize_t __pyx_temp;
14992 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
14993 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
14994 : }
14995 : }
14996 : __Pyx_RefNannyFinishContext();
14997 : return __pyx_r;
14998 : }
14999 :
15000 0 : static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
15001 0 : PyObject *__pyx_r = NULL;
15002 : __Pyx_RefNannyDeclarations
15003 0 : int __pyx_lineno = 0;
15004 0 : const char *__pyx_filename = NULL;
15005 0 : int __pyx_clineno = 0;
15006 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
15007 :
15008 : /* "(tree fragment)":4
15009 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15010 : * def __setstate_cython__(self, __pyx_state):
15011 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
15012 : */
15013 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
15014 0 : __PYX_ERR(1, 4, __pyx_L1_error)
15015 :
15016 : /* "(tree fragment)":3
15017 : * def __reduce_cython__(self):
15018 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15019 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15020 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15021 : */
15022 :
15023 : /* function exit code */
15024 0 : __pyx_L1_error:;
15025 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15026 0 : __pyx_r = NULL;
15027 0 : __Pyx_XGIVEREF(__pyx_r);
15028 0 : __Pyx_RefNannyFinishContext();
15029 0 : return __pyx_r;
15030 : }
15031 :
15032 : /* "View.MemoryView":999
15033 : *
15034 : * @cname('__pyx_memoryview_fromslice')
15035 : * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
15036 : * int ndim,
15037 : * object (*to_object_func)(char *),
15038 : */
15039 :
15040 0 : static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
15041 0 : struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
15042 0 : Py_ssize_t __pyx_v_suboffset;
15043 0 : PyObject *__pyx_v_length = NULL;
15044 0 : PyObject *__pyx_r = NULL;
15045 : __Pyx_RefNannyDeclarations
15046 0 : int __pyx_t_1;
15047 0 : PyObject *__pyx_t_2 = NULL;
15048 0 : PyObject *__pyx_t_3 = NULL;
15049 0 : __Pyx_TypeInfo *__pyx_t_4;
15050 0 : Py_buffer __pyx_t_5;
15051 0 : Py_ssize_t *__pyx_t_6;
15052 0 : Py_ssize_t *__pyx_t_7;
15053 0 : Py_ssize_t *__pyx_t_8;
15054 0 : Py_ssize_t __pyx_t_9;
15055 0 : int __pyx_lineno = 0;
15056 0 : const char *__pyx_filename = NULL;
15057 0 : int __pyx_clineno = 0;
15058 0 : __Pyx_RefNannySetupContext("memoryview_fromslice", 1);
15059 :
15060 : /* "View.MemoryView":1007
15061 : * cdef _memoryviewslice result
15062 : *
15063 : * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
15064 : * return None
15065 : *
15066 : */
15067 0 : __pyx_t_1 = (((PyObject *)__pyx_v_memviewslice.memview) == Py_None);
15068 0 : if (__pyx_t_1) {
15069 :
15070 : /* "View.MemoryView":1008
15071 : *
15072 : * if <PyObject *> memviewslice.memview == Py_None:
15073 : * return None # <<<<<<<<<<<<<<
15074 : *
15075 : *
15076 : */
15077 0 : __Pyx_XDECREF(__pyx_r);
15078 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15079 0 : goto __pyx_L0;
15080 :
15081 : /* "View.MemoryView":1007
15082 : * cdef _memoryviewslice result
15083 : *
15084 : * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
15085 : * return None
15086 : *
15087 : */
15088 : }
15089 :
15090 : /* "View.MemoryView":1013
15091 : *
15092 : *
15093 : * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object) # <<<<<<<<<<<<<<
15094 : *
15095 : * result.from_slice = memviewslice
15096 : */
15097 0 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
15098 0 : __Pyx_GOTREF(__pyx_t_2);
15099 0 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
15100 0 : __Pyx_GOTREF(__pyx_t_3);
15101 0 : __Pyx_INCREF(Py_None);
15102 0 : __Pyx_GIVEREF(Py_None);
15103 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None)) __PYX_ERR(1, 1013, __pyx_L1_error);
15104 0 : __Pyx_INCREF(__pyx_int_0);
15105 0 : __Pyx_GIVEREF(__pyx_int_0);
15106 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0)) __PYX_ERR(1, 1013, __pyx_L1_error);
15107 0 : __Pyx_GIVEREF(__pyx_t_2);
15108 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error);
15109 0 : __pyx_t_2 = 0;
15110 0 : __pyx_t_2 = ((PyObject *)__pyx_tp_new__memoryviewslice(((PyTypeObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
15111 0 : __Pyx_GOTREF((PyObject *)__pyx_t_2);
15112 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15113 0 : __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15114 0 : __pyx_t_2 = 0;
15115 :
15116 : /* "View.MemoryView":1015
15117 : * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object)
15118 : *
15119 : * result.from_slice = memviewslice # <<<<<<<<<<<<<<
15120 : * __PYX_INC_MEMVIEW(&memviewslice, 1)
15121 : *
15122 : */
15123 0 : __pyx_v_result->from_slice = __pyx_v_memviewslice;
15124 :
15125 : /* "View.MemoryView":1016
15126 : *
15127 : * result.from_slice = memviewslice
15128 : * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
15129 : *
15130 : * result.from_object = (<memoryview> memviewslice.memview)._get_base()
15131 : */
15132 0 : __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
15133 :
15134 : /* "View.MemoryView":1018
15135 : * __PYX_INC_MEMVIEW(&memviewslice, 1)
15136 : *
15137 : * result.from_object = (<memoryview> memviewslice.memview)._get_base() # <<<<<<<<<<<<<<
15138 : * result.typeinfo = memviewslice.memview.typeinfo
15139 : *
15140 : */
15141 0 : __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->__pyx_vtab)->_get_base(((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
15142 0 : __Pyx_GOTREF(__pyx_t_2);
15143 0 : __Pyx_GIVEREF(__pyx_t_2);
15144 0 : __Pyx_GOTREF(__pyx_v_result->from_object);
15145 0 : __Pyx_DECREF(__pyx_v_result->from_object);
15146 0 : __pyx_v_result->from_object = __pyx_t_2;
15147 0 : __pyx_t_2 = 0;
15148 :
15149 : /* "View.MemoryView":1019
15150 : *
15151 : * result.from_object = (<memoryview> memviewslice.memview)._get_base()
15152 : * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
15153 : *
15154 : * result.view = memviewslice.memview.view
15155 : */
15156 0 : __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
15157 0 : __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
15158 :
15159 : /* "View.MemoryView":1021
15160 : * result.typeinfo = memviewslice.memview.typeinfo
15161 : *
15162 : * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
15163 : * result.view.buf = <void *> memviewslice.data
15164 : * result.view.ndim = ndim
15165 : */
15166 0 : __pyx_t_5 = __pyx_v_memviewslice.memview->view;
15167 0 : __pyx_v_result->__pyx_base.view = __pyx_t_5;
15168 :
15169 : /* "View.MemoryView":1022
15170 : *
15171 : * result.view = memviewslice.memview.view
15172 : * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
15173 : * result.view.ndim = ndim
15174 : * (<__pyx_buffer *> &result.view).obj = Py_None
15175 : */
15176 0 : __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
15177 :
15178 : /* "View.MemoryView":1023
15179 : * result.view = memviewslice.memview.view
15180 : * result.view.buf = <void *> memviewslice.data
15181 : * result.view.ndim = ndim # <<<<<<<<<<<<<<
15182 : * (<__pyx_buffer *> &result.view).obj = Py_None
15183 : * Py_INCREF(Py_None)
15184 : */
15185 0 : __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
15186 :
15187 : /* "View.MemoryView":1024
15188 : * result.view.buf = <void *> memviewslice.data
15189 : * result.view.ndim = ndim
15190 : * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
15191 : * Py_INCREF(Py_None)
15192 : *
15193 : */
15194 0 : ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
15195 :
15196 : /* "View.MemoryView":1025
15197 : * result.view.ndim = ndim
15198 : * (<__pyx_buffer *> &result.view).obj = Py_None
15199 : * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
15200 : *
15201 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15202 : */
15203 0 : Py_INCREF(Py_None);
15204 :
15205 : /* "View.MemoryView":1027
15206 : * Py_INCREF(Py_None)
15207 : *
15208 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
15209 : * result.flags = PyBUF_RECORDS
15210 : * else:
15211 : */
15212 0 : __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
15213 0 : if (__pyx_t_1) {
15214 :
15215 : /* "View.MemoryView":1028
15216 : *
15217 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15218 : * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
15219 : * else:
15220 : * result.flags = PyBUF_RECORDS_RO
15221 : */
15222 0 : __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
15223 :
15224 : /* "View.MemoryView":1027
15225 : * Py_INCREF(Py_None)
15226 : *
15227 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
15228 : * result.flags = PyBUF_RECORDS
15229 : * else:
15230 : */
15231 0 : goto __pyx_L4;
15232 : }
15233 :
15234 : /* "View.MemoryView":1030
15235 : * result.flags = PyBUF_RECORDS
15236 : * else:
15237 : * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
15238 : *
15239 : * result.view.shape = <Py_ssize_t *> result.from_slice.shape
15240 : */
15241 : /*else*/ {
15242 0 : __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
15243 : }
15244 0 : __pyx_L4:;
15245 :
15246 : /* "View.MemoryView":1032
15247 : * result.flags = PyBUF_RECORDS_RO
15248 : *
15249 : * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
15250 : * result.view.strides = <Py_ssize_t *> result.from_slice.strides
15251 : *
15252 : */
15253 0 : __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
15254 :
15255 : /* "View.MemoryView":1033
15256 : *
15257 : * result.view.shape = <Py_ssize_t *> result.from_slice.shape
15258 : * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
15259 : *
15260 : *
15261 : */
15262 0 : __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
15263 :
15264 : /* "View.MemoryView":1036
15265 : *
15266 : *
15267 : * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
15268 : * for suboffset in result.from_slice.suboffsets[:ndim]:
15269 : * if suboffset >= 0:
15270 : */
15271 0 : __pyx_v_result->__pyx_base.view.suboffsets = NULL;
15272 :
15273 : /* "View.MemoryView":1037
15274 : *
15275 : * result.view.suboffsets = NULL
15276 : * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
15277 : * if suboffset >= 0:
15278 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15279 : */
15280 0 : __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
15281 0 : for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15282 0 : __pyx_t_6 = __pyx_t_8;
15283 0 : __pyx_v_suboffset = (__pyx_t_6[0]);
15284 :
15285 : /* "View.MemoryView":1038
15286 : * result.view.suboffsets = NULL
15287 : * for suboffset in result.from_slice.suboffsets[:ndim]:
15288 : * if suboffset >= 0: # <<<<<<<<<<<<<<
15289 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15290 : * break
15291 : */
15292 0 : __pyx_t_1 = (__pyx_v_suboffset >= 0);
15293 0 : if (__pyx_t_1) {
15294 :
15295 : /* "View.MemoryView":1039
15296 : * for suboffset in result.from_slice.suboffsets[:ndim]:
15297 : * if suboffset >= 0:
15298 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
15299 : * break
15300 : *
15301 : */
15302 0 : __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
15303 :
15304 : /* "View.MemoryView":1040
15305 : * if suboffset >= 0:
15306 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15307 : * break # <<<<<<<<<<<<<<
15308 : *
15309 : * result.view.len = result.view.itemsize
15310 : */
15311 0 : goto __pyx_L6_break;
15312 :
15313 : /* "View.MemoryView":1038
15314 : * result.view.suboffsets = NULL
15315 : * for suboffset in result.from_slice.suboffsets[:ndim]:
15316 : * if suboffset >= 0: # <<<<<<<<<<<<<<
15317 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15318 : * break
15319 : */
15320 : }
15321 : }
15322 0 : __pyx_L6_break:;
15323 :
15324 : /* "View.MemoryView":1042
15325 : * break
15326 : *
15327 : * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
15328 : * for length in result.view.shape[:ndim]:
15329 : * result.view.len *= length
15330 : */
15331 0 : __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
15332 0 : __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15333 :
15334 : /* "View.MemoryView":1043
15335 : *
15336 : * result.view.len = result.view.itemsize
15337 : * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
15338 : * result.view.len *= length
15339 : *
15340 : */
15341 0 : __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
15342 0 : for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15343 0 : __pyx_t_6 = __pyx_t_8;
15344 0 : __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
15345 0 : __Pyx_GOTREF(__pyx_t_2);
15346 0 : __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
15347 0 : __pyx_t_2 = 0;
15348 :
15349 : /* "View.MemoryView":1044
15350 : * result.view.len = result.view.itemsize
15351 : * for length in result.view.shape[:ndim]:
15352 : * result.view.len *= length # <<<<<<<<<<<<<<
15353 : *
15354 : * result.to_object_func = to_object_func
15355 : */
15356 0 : __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
15357 0 : __Pyx_GOTREF(__pyx_t_2);
15358 0 : __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
15359 0 : __Pyx_GOTREF(__pyx_t_3);
15360 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15361 0 : __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
15362 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15363 0 : __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15364 : }
15365 :
15366 : /* "View.MemoryView":1046
15367 : * result.view.len *= length
15368 : *
15369 : * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
15370 : * result.to_dtype_func = to_dtype_func
15371 : *
15372 : */
15373 0 : __pyx_v_result->to_object_func = __pyx_v_to_object_func;
15374 :
15375 : /* "View.MemoryView":1047
15376 : *
15377 : * result.to_object_func = to_object_func
15378 : * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
15379 : *
15380 : * return result
15381 : */
15382 0 : __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
15383 :
15384 : /* "View.MemoryView":1049
15385 : * result.to_dtype_func = to_dtype_func
15386 : *
15387 : * return result # <<<<<<<<<<<<<<
15388 : *
15389 : * @cname('__pyx_memoryview_get_slice_from_memoryview')
15390 : */
15391 0 : __Pyx_XDECREF(__pyx_r);
15392 0 : __Pyx_INCREF((PyObject *)__pyx_v_result);
15393 0 : __pyx_r = ((PyObject *)__pyx_v_result);
15394 0 : goto __pyx_L0;
15395 :
15396 : /* "View.MemoryView":999
15397 : *
15398 : * @cname('__pyx_memoryview_fromslice')
15399 : * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
15400 : * int ndim,
15401 : * object (*to_object_func)(char *),
15402 : */
15403 :
15404 : /* function exit code */
15405 0 : __pyx_L1_error:;
15406 0 : __Pyx_XDECREF(__pyx_t_2);
15407 0 : __Pyx_XDECREF(__pyx_t_3);
15408 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15409 0 : __pyx_r = 0;
15410 0 : __pyx_L0:;
15411 0 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
15412 0 : __Pyx_XDECREF(__pyx_v_length);
15413 0 : __Pyx_XGIVEREF(__pyx_r);
15414 0 : __Pyx_RefNannyFinishContext();
15415 0 : return __pyx_r;
15416 : }
15417 :
15418 : /* "View.MemoryView":1052
15419 : *
15420 : * @cname('__pyx_memoryview_get_slice_from_memoryview')
15421 : * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
15422 : * __Pyx_memviewslice *mslice) except NULL:
15423 : * cdef _memoryviewslice obj
15424 : */
15425 :
15426 0 : static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
15427 0 : struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
15428 0 : __Pyx_memviewslice *__pyx_r;
15429 : __Pyx_RefNannyDeclarations
15430 0 : int __pyx_t_1;
15431 0 : PyObject *__pyx_t_2 = NULL;
15432 0 : int __pyx_lineno = 0;
15433 0 : const char *__pyx_filename = NULL;
15434 0 : int __pyx_clineno = 0;
15435 0 : __Pyx_RefNannySetupContext("get_slice_from_memview", 1);
15436 :
15437 : /* "View.MemoryView":1055
15438 : * __Pyx_memviewslice *mslice) except NULL:
15439 : * cdef _memoryviewslice obj
15440 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15441 : * obj = memview
15442 : * return &obj.from_slice
15443 : */
15444 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15445 0 : if (__pyx_t_1) {
15446 :
15447 : /* "View.MemoryView":1056
15448 : * cdef _memoryviewslice obj
15449 : * if isinstance(memview, _memoryviewslice):
15450 : * obj = memview # <<<<<<<<<<<<<<
15451 : * return &obj.from_slice
15452 : * else:
15453 : */
15454 0 : if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
15455 0 : __pyx_t_2 = ((PyObject *)__pyx_v_memview);
15456 0 : __Pyx_INCREF(__pyx_t_2);
15457 0 : __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15458 0 : __pyx_t_2 = 0;
15459 :
15460 : /* "View.MemoryView":1057
15461 : * if isinstance(memview, _memoryviewslice):
15462 : * obj = memview
15463 : * return &obj.from_slice # <<<<<<<<<<<<<<
15464 : * else:
15465 : * slice_copy(memview, mslice)
15466 : */
15467 0 : __pyx_r = (&__pyx_v_obj->from_slice);
15468 0 : goto __pyx_L0;
15469 :
15470 : /* "View.MemoryView":1055
15471 : * __Pyx_memviewslice *mslice) except NULL:
15472 : * cdef _memoryviewslice obj
15473 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15474 : * obj = memview
15475 : * return &obj.from_slice
15476 : */
15477 : }
15478 :
15479 : /* "View.MemoryView":1059
15480 : * return &obj.from_slice
15481 : * else:
15482 : * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
15483 : * return mslice
15484 : *
15485 : */
15486 : /*else*/ {
15487 0 : __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
15488 :
15489 : /* "View.MemoryView":1060
15490 : * else:
15491 : * slice_copy(memview, mslice)
15492 : * return mslice # <<<<<<<<<<<<<<
15493 : *
15494 : * @cname('__pyx_memoryview_slice_copy')
15495 : */
15496 0 : __pyx_r = __pyx_v_mslice;
15497 0 : goto __pyx_L0;
15498 : }
15499 :
15500 : /* "View.MemoryView":1052
15501 : *
15502 : * @cname('__pyx_memoryview_get_slice_from_memoryview')
15503 : * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
15504 : * __Pyx_memviewslice *mslice) except NULL:
15505 : * cdef _memoryviewslice obj
15506 : */
15507 :
15508 : /* function exit code */
15509 0 : __pyx_L1_error:;
15510 0 : __Pyx_XDECREF(__pyx_t_2);
15511 0 : __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
15512 0 : __pyx_r = NULL;
15513 0 : __pyx_L0:;
15514 0 : __Pyx_XDECREF((PyObject *)__pyx_v_obj);
15515 0 : __Pyx_RefNannyFinishContext();
15516 0 : return __pyx_r;
15517 : }
15518 :
15519 : /* "View.MemoryView":1063
15520 : *
15521 : * @cname('__pyx_memoryview_slice_copy')
15522 : * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept: # <<<<<<<<<<<<<<
15523 : * cdef int dim
15524 : * cdef (Py_ssize_t*) shape, strides, suboffsets
15525 : */
15526 :
15527 0 : static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
15528 0 : int __pyx_v_dim;
15529 0 : Py_ssize_t *__pyx_v_shape;
15530 0 : Py_ssize_t *__pyx_v_strides;
15531 0 : Py_ssize_t *__pyx_v_suboffsets;
15532 0 : Py_ssize_t *__pyx_t_1;
15533 0 : int __pyx_t_2;
15534 0 : int __pyx_t_3;
15535 0 : int __pyx_t_4;
15536 0 : Py_ssize_t __pyx_t_5;
15537 0 : int __pyx_t_6;
15538 :
15539 : /* "View.MemoryView":1067
15540 : * cdef (Py_ssize_t*) shape, strides, suboffsets
15541 : *
15542 : * shape = memview.view.shape # <<<<<<<<<<<<<<
15543 : * strides = memview.view.strides
15544 : * suboffsets = memview.view.suboffsets
15545 : */
15546 0 : __pyx_t_1 = __pyx_v_memview->view.shape;
15547 0 : __pyx_v_shape = __pyx_t_1;
15548 :
15549 : /* "View.MemoryView":1068
15550 : *
15551 : * shape = memview.view.shape
15552 : * strides = memview.view.strides # <<<<<<<<<<<<<<
15553 : * suboffsets = memview.view.suboffsets
15554 : *
15555 : */
15556 0 : __pyx_t_1 = __pyx_v_memview->view.strides;
15557 0 : __pyx_v_strides = __pyx_t_1;
15558 :
15559 : /* "View.MemoryView":1069
15560 : * shape = memview.view.shape
15561 : * strides = memview.view.strides
15562 : * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
15563 : *
15564 : * dst.memview = <__pyx_memoryview *> memview
15565 : */
15566 0 : __pyx_t_1 = __pyx_v_memview->view.suboffsets;
15567 0 : __pyx_v_suboffsets = __pyx_t_1;
15568 :
15569 : /* "View.MemoryView":1071
15570 : * suboffsets = memview.view.suboffsets
15571 : *
15572 : * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
15573 : * dst.data = <char *> memview.view.buf
15574 : *
15575 : */
15576 0 : __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
15577 :
15578 : /* "View.MemoryView":1072
15579 : *
15580 : * dst.memview = <__pyx_memoryview *> memview
15581 : * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
15582 : *
15583 : * for dim in range(memview.view.ndim):
15584 : */
15585 0 : __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
15586 :
15587 : /* "View.MemoryView":1074
15588 : * dst.data = <char *> memview.view.buf
15589 : *
15590 : * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
15591 : * dst.shape[dim] = shape[dim]
15592 : * dst.strides[dim] = strides[dim]
15593 : */
15594 0 : __pyx_t_2 = __pyx_v_memview->view.ndim;
15595 0 : __pyx_t_3 = __pyx_t_2;
15596 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15597 0 : __pyx_v_dim = __pyx_t_4;
15598 :
15599 : /* "View.MemoryView":1075
15600 : *
15601 : * for dim in range(memview.view.ndim):
15602 : * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
15603 : * dst.strides[dim] = strides[dim]
15604 : * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15605 : */
15606 0 : (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
15607 :
15608 : /* "View.MemoryView":1076
15609 : * for dim in range(memview.view.ndim):
15610 : * dst.shape[dim] = shape[dim]
15611 : * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
15612 : * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15613 : *
15614 : */
15615 0 : (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
15616 :
15617 : /* "View.MemoryView":1077
15618 : * dst.shape[dim] = shape[dim]
15619 : * dst.strides[dim] = strides[dim]
15620 : * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
15621 : *
15622 : * @cname('__pyx_memoryview_copy_object')
15623 : */
15624 0 : __pyx_t_6 = (__pyx_v_suboffsets != 0);
15625 0 : if (__pyx_t_6) {
15626 0 : __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
15627 : } else {
15628 : __pyx_t_5 = -1L;
15629 : }
15630 0 : (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
15631 : }
15632 :
15633 : /* "View.MemoryView":1063
15634 : *
15635 : * @cname('__pyx_memoryview_slice_copy')
15636 : * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept: # <<<<<<<<<<<<<<
15637 : * cdef int dim
15638 : * cdef (Py_ssize_t*) shape, strides, suboffsets
15639 : */
15640 :
15641 : /* function exit code */
15642 0 : }
15643 :
15644 : /* "View.MemoryView":1080
15645 : *
15646 : * @cname('__pyx_memoryview_copy_object')
15647 : * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
15648 : * "Create a new memoryview object"
15649 : * cdef __Pyx_memviewslice memviewslice
15650 : */
15651 :
15652 0 : static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
15653 0 : __Pyx_memviewslice __pyx_v_memviewslice;
15654 0 : PyObject *__pyx_r = NULL;
15655 : __Pyx_RefNannyDeclarations
15656 0 : PyObject *__pyx_t_1 = NULL;
15657 0 : int __pyx_lineno = 0;
15658 0 : const char *__pyx_filename = NULL;
15659 0 : int __pyx_clineno = 0;
15660 0 : __Pyx_RefNannySetupContext("memoryview_copy", 1);
15661 :
15662 : /* "View.MemoryView":1083
15663 : * "Create a new memoryview object"
15664 : * cdef __Pyx_memviewslice memviewslice
15665 : * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
15666 : * return memoryview_copy_from_slice(memview, &memviewslice)
15667 : *
15668 : */
15669 0 : __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
15670 :
15671 : /* "View.MemoryView":1084
15672 : * cdef __Pyx_memviewslice memviewslice
15673 : * slice_copy(memview, &memviewslice)
15674 : * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
15675 : *
15676 : * @cname('__pyx_memoryview_copy_object_from_slice')
15677 : */
15678 0 : __Pyx_XDECREF(__pyx_r);
15679 0 : __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
15680 0 : __Pyx_GOTREF(__pyx_t_1);
15681 0 : __pyx_r = __pyx_t_1;
15682 0 : __pyx_t_1 = 0;
15683 0 : goto __pyx_L0;
15684 :
15685 : /* "View.MemoryView":1080
15686 : *
15687 : * @cname('__pyx_memoryview_copy_object')
15688 : * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
15689 : * "Create a new memoryview object"
15690 : * cdef __Pyx_memviewslice memviewslice
15691 : */
15692 :
15693 : /* function exit code */
15694 0 : __pyx_L1_error:;
15695 0 : __Pyx_XDECREF(__pyx_t_1);
15696 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
15697 0 : __pyx_r = 0;
15698 0 : __pyx_L0:;
15699 0 : __Pyx_XGIVEREF(__pyx_r);
15700 0 : __Pyx_RefNannyFinishContext();
15701 0 : return __pyx_r;
15702 : }
15703 :
15704 : /* "View.MemoryView":1087
15705 : *
15706 : * @cname('__pyx_memoryview_copy_object_from_slice')
15707 : * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
15708 : * """
15709 : * Create a new memoryview object from a given memoryview object and slice.
15710 : */
15711 :
15712 0 : static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
15713 0 : PyObject *(*__pyx_v_to_object_func)(char *);
15714 0 : int (*__pyx_v_to_dtype_func)(char *, PyObject *);
15715 0 : PyObject *__pyx_r = NULL;
15716 : __Pyx_RefNannyDeclarations
15717 0 : int __pyx_t_1;
15718 0 : PyObject *(*__pyx_t_2)(char *);
15719 0 : int (*__pyx_t_3)(char *, PyObject *);
15720 0 : PyObject *__pyx_t_4 = NULL;
15721 0 : int __pyx_lineno = 0;
15722 0 : const char *__pyx_filename = NULL;
15723 0 : int __pyx_clineno = 0;
15724 0 : __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 1);
15725 :
15726 : /* "View.MemoryView":1094
15727 : * cdef int (*to_dtype_func)(char *, object) except 0
15728 : *
15729 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15730 : * to_object_func = (<_memoryviewslice> memview).to_object_func
15731 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15732 : */
15733 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15734 0 : if (__pyx_t_1) {
15735 :
15736 : /* "View.MemoryView":1095
15737 : *
15738 : * if isinstance(memview, _memoryviewslice):
15739 : * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
15740 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15741 : * else:
15742 : */
15743 0 : __pyx_t_2 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
15744 0 : __pyx_v_to_object_func = __pyx_t_2;
15745 :
15746 : /* "View.MemoryView":1096
15747 : * if isinstance(memview, _memoryviewslice):
15748 : * to_object_func = (<_memoryviewslice> memview).to_object_func
15749 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
15750 : * else:
15751 : * to_object_func = NULL
15752 : */
15753 0 : __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
15754 0 : __pyx_v_to_dtype_func = __pyx_t_3;
15755 :
15756 : /* "View.MemoryView":1094
15757 : * cdef int (*to_dtype_func)(char *, object) except 0
15758 : *
15759 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15760 : * to_object_func = (<_memoryviewslice> memview).to_object_func
15761 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15762 : */
15763 0 : goto __pyx_L3;
15764 : }
15765 :
15766 : /* "View.MemoryView":1098
15767 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15768 : * else:
15769 : * to_object_func = NULL # <<<<<<<<<<<<<<
15770 : * to_dtype_func = NULL
15771 : *
15772 : */
15773 : /*else*/ {
15774 : __pyx_v_to_object_func = NULL;
15775 :
15776 : /* "View.MemoryView":1099
15777 : * else:
15778 : * to_object_func = NULL
15779 : * to_dtype_func = NULL # <<<<<<<<<<<<<<
15780 : *
15781 : * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
15782 : */
15783 : __pyx_v_to_dtype_func = NULL;
15784 : }
15785 0 : __pyx_L3:;
15786 :
15787 : /* "View.MemoryView":1101
15788 : * to_dtype_func = NULL
15789 : *
15790 : * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
15791 : * to_object_func, to_dtype_func,
15792 : * memview.dtype_is_object)
15793 : */
15794 0 : __Pyx_XDECREF(__pyx_r);
15795 :
15796 : /* "View.MemoryView":1103
15797 : * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
15798 : * to_object_func, to_dtype_func,
15799 : * memview.dtype_is_object) # <<<<<<<<<<<<<<
15800 : *
15801 : *
15802 : */
15803 0 : __pyx_t_4 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1101, __pyx_L1_error)
15804 0 : __Pyx_GOTREF(__pyx_t_4);
15805 0 : __pyx_r = __pyx_t_4;
15806 0 : __pyx_t_4 = 0;
15807 0 : goto __pyx_L0;
15808 :
15809 : /* "View.MemoryView":1087
15810 : *
15811 : * @cname('__pyx_memoryview_copy_object_from_slice')
15812 : * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
15813 : * """
15814 : * Create a new memoryview object from a given memoryview object and slice.
15815 : */
15816 :
15817 : /* function exit code */
15818 0 : __pyx_L1_error:;
15819 0 : __Pyx_XDECREF(__pyx_t_4);
15820 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15821 0 : __pyx_r = 0;
15822 0 : __pyx_L0:;
15823 0 : __Pyx_XGIVEREF(__pyx_r);
15824 0 : __Pyx_RefNannyFinishContext();
15825 0 : return __pyx_r;
15826 : }
15827 :
15828 : /* "View.MemoryView":1109
15829 : *
15830 : *
15831 : * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
15832 : * return -arg if arg < 0 else arg
15833 : *
15834 : */
15835 :
15836 0 : static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
15837 0 : Py_ssize_t __pyx_r;
15838 0 : Py_ssize_t __pyx_t_1;
15839 0 : int __pyx_t_2;
15840 :
15841 : /* "View.MemoryView":1110
15842 : *
15843 : * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil:
15844 : * return -arg if arg < 0 else arg # <<<<<<<<<<<<<<
15845 : *
15846 : * @cname('__pyx_get_best_slice_order')
15847 : */
15848 0 : __pyx_t_2 = (__pyx_v_arg < 0);
15849 0 : if (__pyx_t_2) {
15850 : __pyx_t_1 = (-__pyx_v_arg);
15851 : } else {
15852 : __pyx_t_1 = __pyx_v_arg;
15853 : }
15854 0 : __pyx_r = __pyx_t_1;
15855 0 : goto __pyx_L0;
15856 :
15857 : /* "View.MemoryView":1109
15858 : *
15859 : *
15860 : * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
15861 : * return -arg if arg < 0 else arg
15862 : *
15863 : */
15864 :
15865 : /* function exit code */
15866 0 : __pyx_L0:;
15867 0 : return __pyx_r;
15868 : }
15869 :
15870 : /* "View.MemoryView":1113
15871 : *
15872 : * @cname('__pyx_get_best_slice_order')
15873 : * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
15874 : * """
15875 : * Figure out the best memory access order for a given slice.
15876 : */
15877 :
15878 0 : static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
15879 0 : int __pyx_v_i;
15880 0 : Py_ssize_t __pyx_v_c_stride;
15881 0 : Py_ssize_t __pyx_v_f_stride;
15882 0 : char __pyx_r;
15883 0 : int __pyx_t_1;
15884 0 : int __pyx_t_2;
15885 0 : int __pyx_t_3;
15886 0 : int __pyx_t_4;
15887 :
15888 : /* "View.MemoryView":1118
15889 : * """
15890 : * cdef int i
15891 : * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
15892 : * cdef Py_ssize_t f_stride = 0
15893 : *
15894 : */
15895 0 : __pyx_v_c_stride = 0;
15896 :
15897 : /* "View.MemoryView":1119
15898 : * cdef int i
15899 : * cdef Py_ssize_t c_stride = 0
15900 : * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
15901 : *
15902 : * for i in range(ndim - 1, -1, -1):
15903 : */
15904 0 : __pyx_v_f_stride = 0;
15905 :
15906 : /* "View.MemoryView":1121
15907 : * cdef Py_ssize_t f_stride = 0
15908 : *
15909 : * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
15910 : * if mslice.shape[i] > 1:
15911 : * c_stride = mslice.strides[i]
15912 : */
15913 0 : for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
15914 0 : __pyx_v_i = __pyx_t_1;
15915 :
15916 : /* "View.MemoryView":1122
15917 : *
15918 : * for i in range(ndim - 1, -1, -1):
15919 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15920 : * c_stride = mslice.strides[i]
15921 : * break
15922 : */
15923 0 : __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
15924 0 : if (__pyx_t_2) {
15925 :
15926 : /* "View.MemoryView":1123
15927 : * for i in range(ndim - 1, -1, -1):
15928 : * if mslice.shape[i] > 1:
15929 : * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
15930 : * break
15931 : *
15932 : */
15933 0 : __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
15934 :
15935 : /* "View.MemoryView":1124
15936 : * if mslice.shape[i] > 1:
15937 : * c_stride = mslice.strides[i]
15938 : * break # <<<<<<<<<<<<<<
15939 : *
15940 : * for i in range(ndim):
15941 : */
15942 0 : goto __pyx_L4_break;
15943 :
15944 : /* "View.MemoryView":1122
15945 : *
15946 : * for i in range(ndim - 1, -1, -1):
15947 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15948 : * c_stride = mslice.strides[i]
15949 : * break
15950 : */
15951 : }
15952 : }
15953 0 : __pyx_L4_break:;
15954 :
15955 : /* "View.MemoryView":1126
15956 : * break
15957 : *
15958 : * for i in range(ndim): # <<<<<<<<<<<<<<
15959 : * if mslice.shape[i] > 1:
15960 : * f_stride = mslice.strides[i]
15961 : */
15962 0 : __pyx_t_1 = __pyx_v_ndim;
15963 0 : __pyx_t_3 = __pyx_t_1;
15964 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15965 0 : __pyx_v_i = __pyx_t_4;
15966 :
15967 : /* "View.MemoryView":1127
15968 : *
15969 : * for i in range(ndim):
15970 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15971 : * f_stride = mslice.strides[i]
15972 : * break
15973 : */
15974 0 : __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
15975 0 : if (__pyx_t_2) {
15976 :
15977 : /* "View.MemoryView":1128
15978 : * for i in range(ndim):
15979 : * if mslice.shape[i] > 1:
15980 : * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
15981 : * break
15982 : *
15983 : */
15984 0 : __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
15985 :
15986 : /* "View.MemoryView":1129
15987 : * if mslice.shape[i] > 1:
15988 : * f_stride = mslice.strides[i]
15989 : * break # <<<<<<<<<<<<<<
15990 : *
15991 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
15992 : */
15993 0 : goto __pyx_L7_break;
15994 :
15995 : /* "View.MemoryView":1127
15996 : *
15997 : * for i in range(ndim):
15998 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15999 : * f_stride = mslice.strides[i]
16000 : * break
16001 : */
16002 : }
16003 : }
16004 0 : __pyx_L7_break:;
16005 :
16006 : /* "View.MemoryView":1131
16007 : * break
16008 : *
16009 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
16010 : * return 'C'
16011 : * else:
16012 : */
16013 0 : __pyx_t_2 = (abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride));
16014 0 : if (__pyx_t_2) {
16015 :
16016 : /* "View.MemoryView":1132
16017 : *
16018 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
16019 : * return 'C' # <<<<<<<<<<<<<<
16020 : * else:
16021 : * return 'F'
16022 : */
16023 0 : __pyx_r = 'C';
16024 0 : goto __pyx_L0;
16025 :
16026 : /* "View.MemoryView":1131
16027 : * break
16028 : *
16029 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
16030 : * return 'C'
16031 : * else:
16032 : */
16033 : }
16034 :
16035 : /* "View.MemoryView":1134
16036 : * return 'C'
16037 : * else:
16038 : * return 'F' # <<<<<<<<<<<<<<
16039 : *
16040 : * @cython.cdivision(True)
16041 : */
16042 : /*else*/ {
16043 0 : __pyx_r = 'F';
16044 0 : goto __pyx_L0;
16045 : }
16046 :
16047 : /* "View.MemoryView":1113
16048 : *
16049 : * @cname('__pyx_get_best_slice_order')
16050 : * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
16051 : * """
16052 : * Figure out the best memory access order for a given slice.
16053 : */
16054 :
16055 : /* function exit code */
16056 0 : __pyx_L0:;
16057 0 : return __pyx_r;
16058 : }
16059 :
16060 : /* "View.MemoryView":1137
16061 : *
16062 : * @cython.cdivision(True)
16063 : * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
16064 : * char *dst_data, Py_ssize_t *dst_strides,
16065 : * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
16066 : */
16067 :
16068 0 : static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
16069 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_i;
16070 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
16071 0 : Py_ssize_t __pyx_v_dst_extent;
16072 0 : Py_ssize_t __pyx_v_src_stride;
16073 0 : Py_ssize_t __pyx_v_dst_stride;
16074 0 : int __pyx_t_1;
16075 0 : int __pyx_t_2;
16076 0 : Py_ssize_t __pyx_t_3;
16077 0 : Py_ssize_t __pyx_t_4;
16078 0 : Py_ssize_t __pyx_t_5;
16079 :
16080 : /* "View.MemoryView":1144
16081 : *
16082 : * cdef Py_ssize_t i
16083 : * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
16084 : * cdef Py_ssize_t dst_extent = dst_shape[0]
16085 : * cdef Py_ssize_t src_stride = src_strides[0]
16086 : */
16087 0 : __pyx_v_src_extent = (__pyx_v_src_shape[0]);
16088 :
16089 : /* "View.MemoryView":1145
16090 : * cdef Py_ssize_t i
16091 : * cdef Py_ssize_t src_extent = src_shape[0]
16092 : * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
16093 : * cdef Py_ssize_t src_stride = src_strides[0]
16094 : * cdef Py_ssize_t dst_stride = dst_strides[0]
16095 : */
16096 0 : __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
16097 :
16098 : /* "View.MemoryView":1146
16099 : * cdef Py_ssize_t src_extent = src_shape[0]
16100 : * cdef Py_ssize_t dst_extent = dst_shape[0]
16101 : * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
16102 : * cdef Py_ssize_t dst_stride = dst_strides[0]
16103 : *
16104 : */
16105 0 : __pyx_v_src_stride = (__pyx_v_src_strides[0]);
16106 :
16107 : /* "View.MemoryView":1147
16108 : * cdef Py_ssize_t dst_extent = dst_shape[0]
16109 : * cdef Py_ssize_t src_stride = src_strides[0]
16110 : * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
16111 : *
16112 : * if ndim == 1:
16113 : */
16114 0 : __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
16115 :
16116 : /* "View.MemoryView":1149
16117 : * cdef Py_ssize_t dst_stride = dst_strides[0]
16118 : *
16119 : * if ndim == 1: # <<<<<<<<<<<<<<
16120 : * if (src_stride > 0 and dst_stride > 0 and
16121 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16122 : */
16123 0 : __pyx_t_1 = (__pyx_v_ndim == 1);
16124 0 : if (__pyx_t_1) {
16125 :
16126 : /* "View.MemoryView":1150
16127 : *
16128 : * if ndim == 1:
16129 : * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16130 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16131 : * memcpy(dst_data, src_data, itemsize * dst_extent)
16132 : */
16133 0 : __pyx_t_2 = (__pyx_v_src_stride > 0);
16134 0 : if (__pyx_t_2) {
16135 0 : } else {
16136 0 : __pyx_t_1 = __pyx_t_2;
16137 0 : goto __pyx_L5_bool_binop_done;
16138 : }
16139 0 : __pyx_t_2 = (__pyx_v_dst_stride > 0);
16140 0 : if (__pyx_t_2) {
16141 0 : } else {
16142 0 : __pyx_t_1 = __pyx_t_2;
16143 0 : goto __pyx_L5_bool_binop_done;
16144 : }
16145 :
16146 : /* "View.MemoryView":1151
16147 : * if ndim == 1:
16148 : * if (src_stride > 0 and dst_stride > 0 and
16149 : * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
16150 : * memcpy(dst_data, src_data, itemsize * dst_extent)
16151 : * else:
16152 : */
16153 0 : __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
16154 0 : if (__pyx_t_2) {
16155 0 : __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
16156 : }
16157 : __pyx_t_1 = __pyx_t_2;
16158 0 : __pyx_L5_bool_binop_done:;
16159 :
16160 : /* "View.MemoryView":1150
16161 : *
16162 : * if ndim == 1:
16163 : * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16164 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16165 : * memcpy(dst_data, src_data, itemsize * dst_extent)
16166 : */
16167 0 : if (__pyx_t_1) {
16168 :
16169 : /* "View.MemoryView":1152
16170 : * if (src_stride > 0 and dst_stride > 0 and
16171 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16172 : * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
16173 : * else:
16174 : * for i in range(dst_extent):
16175 : */
16176 0 : (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
16177 :
16178 : /* "View.MemoryView":1150
16179 : *
16180 : * if ndim == 1:
16181 : * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16182 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16183 : * memcpy(dst_data, src_data, itemsize * dst_extent)
16184 : */
16185 0 : goto __pyx_L4;
16186 : }
16187 :
16188 : /* "View.MemoryView":1154
16189 : * memcpy(dst_data, src_data, itemsize * dst_extent)
16190 : * else:
16191 : * for i in range(dst_extent): # <<<<<<<<<<<<<<
16192 : * memcpy(dst_data, src_data, itemsize)
16193 : * src_data += src_stride
16194 : */
16195 : /*else*/ {
16196 : __pyx_t_3 = __pyx_v_dst_extent;
16197 : __pyx_t_4 = __pyx_t_3;
16198 0 : for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16199 0 : __pyx_v_i = __pyx_t_5;
16200 :
16201 : /* "View.MemoryView":1155
16202 : * else:
16203 : * for i in range(dst_extent):
16204 : * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
16205 : * src_data += src_stride
16206 : * dst_data += dst_stride
16207 : */
16208 0 : (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
16209 :
16210 : /* "View.MemoryView":1156
16211 : * for i in range(dst_extent):
16212 : * memcpy(dst_data, src_data, itemsize)
16213 : * src_data += src_stride # <<<<<<<<<<<<<<
16214 : * dst_data += dst_stride
16215 : * else:
16216 : */
16217 0 : __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16218 :
16219 : /* "View.MemoryView":1157
16220 : * memcpy(dst_data, src_data, itemsize)
16221 : * src_data += src_stride
16222 : * dst_data += dst_stride # <<<<<<<<<<<<<<
16223 : * else:
16224 : * for i in range(dst_extent):
16225 : */
16226 0 : __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16227 : }
16228 : }
16229 0 : __pyx_L4:;
16230 :
16231 : /* "View.MemoryView":1149
16232 : * cdef Py_ssize_t dst_stride = dst_strides[0]
16233 : *
16234 : * if ndim == 1: # <<<<<<<<<<<<<<
16235 : * if (src_stride > 0 and dst_stride > 0 and
16236 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16237 : */
16238 0 : goto __pyx_L3;
16239 : }
16240 :
16241 : /* "View.MemoryView":1159
16242 : * dst_data += dst_stride
16243 : * else:
16244 : * for i in range(dst_extent): # <<<<<<<<<<<<<<
16245 : * _copy_strided_to_strided(src_data, src_strides + 1,
16246 : * dst_data, dst_strides + 1,
16247 : */
16248 : /*else*/ {
16249 : __pyx_t_3 = __pyx_v_dst_extent;
16250 : __pyx_t_4 = __pyx_t_3;
16251 0 : for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16252 0 : __pyx_v_i = __pyx_t_5;
16253 :
16254 : /* "View.MemoryView":1160
16255 : * else:
16256 : * for i in range(dst_extent):
16257 : * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
16258 : * dst_data, dst_strides + 1,
16259 : * src_shape + 1, dst_shape + 1,
16260 : */
16261 0 : _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
16262 :
16263 : /* "View.MemoryView":1164
16264 : * src_shape + 1, dst_shape + 1,
16265 : * ndim - 1, itemsize)
16266 : * src_data += src_stride # <<<<<<<<<<<<<<
16267 : * dst_data += dst_stride
16268 : *
16269 : */
16270 0 : __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16271 :
16272 : /* "View.MemoryView":1165
16273 : * ndim - 1, itemsize)
16274 : * src_data += src_stride
16275 : * dst_data += dst_stride # <<<<<<<<<<<<<<
16276 : *
16277 : * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
16278 : */
16279 0 : __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16280 : }
16281 : }
16282 0 : __pyx_L3:;
16283 :
16284 : /* "View.MemoryView":1137
16285 : *
16286 : * @cython.cdivision(True)
16287 : * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
16288 : * char *dst_data, Py_ssize_t *dst_strides,
16289 : * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
16290 : */
16291 :
16292 : /* function exit code */
16293 0 : }
16294 :
16295 : /* "View.MemoryView":1167
16296 : * dst_data += dst_stride
16297 : *
16298 : * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16299 : * __Pyx_memviewslice *dst,
16300 : * int ndim, size_t itemsize) noexcept nogil:
16301 : */
16302 :
16303 0 : static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
16304 :
16305 : /* "View.MemoryView":1170
16306 : * __Pyx_memviewslice *dst,
16307 : * int ndim, size_t itemsize) noexcept nogil:
16308 : * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
16309 : * src.shape, dst.shape, ndim, itemsize)
16310 : *
16311 : */
16312 0 : _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
16313 :
16314 : /* "View.MemoryView":1167
16315 : * dst_data += dst_stride
16316 : *
16317 : * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16318 : * __Pyx_memviewslice *dst,
16319 : * int ndim, size_t itemsize) noexcept nogil:
16320 : */
16321 :
16322 : /* function exit code */
16323 0 : }
16324 :
16325 : /* "View.MemoryView":1174
16326 : *
16327 : * @cname('__pyx_memoryview_slice_get_size')
16328 : * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
16329 : * "Return the size of the memory occupied by the slice in number of bytes"
16330 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize
16331 : */
16332 :
16333 0 : static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
16334 0 : Py_ssize_t __pyx_v_shape;
16335 0 : Py_ssize_t __pyx_v_size;
16336 0 : Py_ssize_t __pyx_r;
16337 0 : Py_ssize_t __pyx_t_1;
16338 0 : Py_ssize_t *__pyx_t_2;
16339 0 : Py_ssize_t *__pyx_t_3;
16340 0 : Py_ssize_t *__pyx_t_4;
16341 :
16342 : /* "View.MemoryView":1176
16343 : * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
16344 : * "Return the size of the memory occupied by the slice in number of bytes"
16345 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
16346 : *
16347 : * for shape in src.shape[:ndim]:
16348 : */
16349 0 : __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
16350 0 : __pyx_v_size = __pyx_t_1;
16351 :
16352 : /* "View.MemoryView":1178
16353 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize
16354 : *
16355 : * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
16356 : * size *= shape
16357 : *
16358 : */
16359 0 : __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
16360 0 : for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
16361 0 : __pyx_t_2 = __pyx_t_4;
16362 0 : __pyx_v_shape = (__pyx_t_2[0]);
16363 :
16364 : /* "View.MemoryView":1179
16365 : *
16366 : * for shape in src.shape[:ndim]:
16367 : * size *= shape # <<<<<<<<<<<<<<
16368 : *
16369 : * return size
16370 : */
16371 0 : __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
16372 : }
16373 :
16374 : /* "View.MemoryView":1181
16375 : * size *= shape
16376 : *
16377 : * return size # <<<<<<<<<<<<<<
16378 : *
16379 : * @cname('__pyx_fill_contig_strides_array')
16380 : */
16381 0 : __pyx_r = __pyx_v_size;
16382 0 : goto __pyx_L0;
16383 :
16384 : /* "View.MemoryView":1174
16385 : *
16386 : * @cname('__pyx_memoryview_slice_get_size')
16387 : * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
16388 : * "Return the size of the memory occupied by the slice in number of bytes"
16389 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize
16390 : */
16391 :
16392 : /* function exit code */
16393 0 : __pyx_L0:;
16394 0 : return __pyx_r;
16395 : }
16396 :
16397 : /* "View.MemoryView":1184
16398 : *
16399 : * @cname('__pyx_fill_contig_strides_array')
16400 : * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
16401 : * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
16402 : * int ndim, char order) noexcept nogil:
16403 : */
16404 :
16405 0 : static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
16406 0 : int __pyx_v_idx;
16407 0 : Py_ssize_t __pyx_r;
16408 0 : int __pyx_t_1;
16409 0 : int __pyx_t_2;
16410 0 : int __pyx_t_3;
16411 0 : int __pyx_t_4;
16412 :
16413 : /* "View.MemoryView":1193
16414 : * cdef int idx
16415 : *
16416 : * if order == 'F': # <<<<<<<<<<<<<<
16417 : * for idx in range(ndim):
16418 : * strides[idx] = stride
16419 : */
16420 0 : __pyx_t_1 = (__pyx_v_order == 'F');
16421 0 : if (__pyx_t_1) {
16422 :
16423 : /* "View.MemoryView":1194
16424 : *
16425 : * if order == 'F':
16426 : * for idx in range(ndim): # <<<<<<<<<<<<<<
16427 : * strides[idx] = stride
16428 : * stride *= shape[idx]
16429 : */
16430 0 : __pyx_t_2 = __pyx_v_ndim;
16431 : __pyx_t_3 = __pyx_t_2;
16432 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16433 0 : __pyx_v_idx = __pyx_t_4;
16434 :
16435 : /* "View.MemoryView":1195
16436 : * if order == 'F':
16437 : * for idx in range(ndim):
16438 : * strides[idx] = stride # <<<<<<<<<<<<<<
16439 : * stride *= shape[idx]
16440 : * else:
16441 : */
16442 0 : (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16443 :
16444 : /* "View.MemoryView":1196
16445 : * for idx in range(ndim):
16446 : * strides[idx] = stride
16447 : * stride *= shape[idx] # <<<<<<<<<<<<<<
16448 : * else:
16449 : * for idx in range(ndim - 1, -1, -1):
16450 : */
16451 0 : __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16452 : }
16453 :
16454 : /* "View.MemoryView":1193
16455 : * cdef int idx
16456 : *
16457 : * if order == 'F': # <<<<<<<<<<<<<<
16458 : * for idx in range(ndim):
16459 : * strides[idx] = stride
16460 : */
16461 0 : goto __pyx_L3;
16462 : }
16463 :
16464 : /* "View.MemoryView":1198
16465 : * stride *= shape[idx]
16466 : * else:
16467 : * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
16468 : * strides[idx] = stride
16469 : * stride *= shape[idx]
16470 : */
16471 : /*else*/ {
16472 0 : for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
16473 0 : __pyx_v_idx = __pyx_t_2;
16474 :
16475 : /* "View.MemoryView":1199
16476 : * else:
16477 : * for idx in range(ndim - 1, -1, -1):
16478 : * strides[idx] = stride # <<<<<<<<<<<<<<
16479 : * stride *= shape[idx]
16480 : *
16481 : */
16482 0 : (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16483 :
16484 : /* "View.MemoryView":1200
16485 : * for idx in range(ndim - 1, -1, -1):
16486 : * strides[idx] = stride
16487 : * stride *= shape[idx] # <<<<<<<<<<<<<<
16488 : *
16489 : * return stride
16490 : */
16491 0 : __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16492 : }
16493 : }
16494 0 : __pyx_L3:;
16495 :
16496 : /* "View.MemoryView":1202
16497 : * stride *= shape[idx]
16498 : *
16499 : * return stride # <<<<<<<<<<<<<<
16500 : *
16501 : * @cname('__pyx_memoryview_copy_data_to_temp')
16502 : */
16503 0 : __pyx_r = __pyx_v_stride;
16504 0 : goto __pyx_L0;
16505 :
16506 : /* "View.MemoryView":1184
16507 : *
16508 : * @cname('__pyx_fill_contig_strides_array')
16509 : * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
16510 : * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
16511 : * int ndim, char order) noexcept nogil:
16512 : */
16513 :
16514 : /* function exit code */
16515 0 : __pyx_L0:;
16516 0 : return __pyx_r;
16517 : }
16518 :
16519 : /* "View.MemoryView":1205
16520 : *
16521 : * @cname('__pyx_memoryview_copy_data_to_temp')
16522 : * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16523 : * __Pyx_memviewslice *tmpslice,
16524 : * char order,
16525 : */
16526 :
16527 0 : static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
16528 0 : int __pyx_v_i;
16529 0 : void *__pyx_v_result;
16530 0 : size_t __pyx_v_itemsize;
16531 0 : size_t __pyx_v_size;
16532 0 : void *__pyx_r;
16533 0 : Py_ssize_t __pyx_t_1;
16534 0 : int __pyx_t_2;
16535 0 : int __pyx_t_3;
16536 0 : struct __pyx_memoryview_obj *__pyx_t_4;
16537 0 : int __pyx_t_5;
16538 0 : int __pyx_t_6;
16539 0 : int __pyx_lineno = 0;
16540 0 : const char *__pyx_filename = NULL;
16541 0 : int __pyx_clineno = 0;
16542 : #ifdef WITH_THREAD
16543 0 : PyGILState_STATE __pyx_gilstate_save;
16544 : #endif
16545 :
16546 : /* "View.MemoryView":1216
16547 : * cdef void *result
16548 : *
16549 : * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
16550 : * cdef size_t size = slice_get_size(src, ndim)
16551 : *
16552 : */
16553 0 : __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
16554 0 : __pyx_v_itemsize = __pyx_t_1;
16555 :
16556 : /* "View.MemoryView":1217
16557 : *
16558 : * cdef size_t itemsize = src.memview.view.itemsize
16559 : * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
16560 : *
16561 : * result = malloc(size)
16562 : */
16563 0 : __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
16564 :
16565 : /* "View.MemoryView":1219
16566 : * cdef size_t size = slice_get_size(src, ndim)
16567 : *
16568 : * result = malloc(size) # <<<<<<<<<<<<<<
16569 : * if not result:
16570 : * _err_no_memory()
16571 : */
16572 0 : __pyx_v_result = malloc(__pyx_v_size);
16573 :
16574 : /* "View.MemoryView":1220
16575 : *
16576 : * result = malloc(size)
16577 : * if not result: # <<<<<<<<<<<<<<
16578 : * _err_no_memory()
16579 : *
16580 : */
16581 0 : __pyx_t_2 = (!(__pyx_v_result != 0));
16582 0 : if (__pyx_t_2) {
16583 :
16584 : /* "View.MemoryView":1221
16585 : * result = malloc(size)
16586 : * if not result:
16587 : * _err_no_memory() # <<<<<<<<<<<<<<
16588 : *
16589 : *
16590 : */
16591 0 : __pyx_t_3 = __pyx_memoryview_err_no_memory(); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1221, __pyx_L1_error)
16592 :
16593 : /* "View.MemoryView":1220
16594 : *
16595 : * result = malloc(size)
16596 : * if not result: # <<<<<<<<<<<<<<
16597 : * _err_no_memory()
16598 : *
16599 : */
16600 : }
16601 :
16602 : /* "View.MemoryView":1224
16603 : *
16604 : *
16605 : * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
16606 : * tmpslice.memview = src.memview
16607 : * for i in range(ndim):
16608 : */
16609 0 : __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
16610 :
16611 : /* "View.MemoryView":1225
16612 : *
16613 : * tmpslice.data = <char *> result
16614 : * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
16615 : * for i in range(ndim):
16616 : * tmpslice.shape[i] = src.shape[i]
16617 : */
16618 0 : __pyx_t_4 = __pyx_v_src->memview;
16619 0 : __pyx_v_tmpslice->memview = __pyx_t_4;
16620 :
16621 : /* "View.MemoryView":1226
16622 : * tmpslice.data = <char *> result
16623 : * tmpslice.memview = src.memview
16624 : * for i in range(ndim): # <<<<<<<<<<<<<<
16625 : * tmpslice.shape[i] = src.shape[i]
16626 : * tmpslice.suboffsets[i] = -1
16627 : */
16628 0 : __pyx_t_3 = __pyx_v_ndim;
16629 0 : __pyx_t_5 = __pyx_t_3;
16630 0 : for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16631 0 : __pyx_v_i = __pyx_t_6;
16632 :
16633 : /* "View.MemoryView":1227
16634 : * tmpslice.memview = src.memview
16635 : * for i in range(ndim):
16636 : * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
16637 : * tmpslice.suboffsets[i] = -1
16638 : *
16639 : */
16640 0 : (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
16641 :
16642 : /* "View.MemoryView":1228
16643 : * for i in range(ndim):
16644 : * tmpslice.shape[i] = src.shape[i]
16645 : * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
16646 : *
16647 : * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, ndim, order)
16648 : */
16649 0 : (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
16650 : }
16651 :
16652 : /* "View.MemoryView":1230
16653 : * tmpslice.suboffsets[i] = -1
16654 : *
16655 : * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, ndim, order) # <<<<<<<<<<<<<<
16656 : *
16657 : *
16658 : */
16659 0 : (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
16660 :
16661 : /* "View.MemoryView":1233
16662 : *
16663 : *
16664 : * for i in range(ndim): # <<<<<<<<<<<<<<
16665 : * if tmpslice.shape[i] == 1:
16666 : * tmpslice.strides[i] = 0
16667 : */
16668 0 : __pyx_t_3 = __pyx_v_ndim;
16669 0 : __pyx_t_5 = __pyx_t_3;
16670 0 : for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16671 0 : __pyx_v_i = __pyx_t_6;
16672 :
16673 : /* "View.MemoryView":1234
16674 : *
16675 : * for i in range(ndim):
16676 : * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
16677 : * tmpslice.strides[i] = 0
16678 : *
16679 : */
16680 0 : __pyx_t_2 = ((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1);
16681 0 : if (__pyx_t_2) {
16682 :
16683 : /* "View.MemoryView":1235
16684 : * for i in range(ndim):
16685 : * if tmpslice.shape[i] == 1:
16686 : * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
16687 : *
16688 : * if slice_is_contig(src[0], order, ndim):
16689 : */
16690 0 : (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
16691 :
16692 : /* "View.MemoryView":1234
16693 : *
16694 : * for i in range(ndim):
16695 : * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
16696 : * tmpslice.strides[i] = 0
16697 : *
16698 : */
16699 : }
16700 : }
16701 :
16702 : /* "View.MemoryView":1237
16703 : * tmpslice.strides[i] = 0
16704 : *
16705 : * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
16706 : * memcpy(result, src.data, size)
16707 : * else:
16708 : */
16709 0 : __pyx_t_2 = __pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim);
16710 0 : if (__pyx_t_2) {
16711 :
16712 : /* "View.MemoryView":1238
16713 : *
16714 : * if slice_is_contig(src[0], order, ndim):
16715 : * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
16716 : * else:
16717 : * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
16718 : */
16719 0 : (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
16720 :
16721 : /* "View.MemoryView":1237
16722 : * tmpslice.strides[i] = 0
16723 : *
16724 : * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
16725 : * memcpy(result, src.data, size)
16726 : * else:
16727 : */
16728 0 : goto __pyx_L9;
16729 : }
16730 :
16731 : /* "View.MemoryView":1240
16732 : * memcpy(result, src.data, size)
16733 : * else:
16734 : * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
16735 : *
16736 : * return result
16737 : */
16738 : /*else*/ {
16739 0 : copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
16740 : }
16741 0 : __pyx_L9:;
16742 :
16743 : /* "View.MemoryView":1242
16744 : * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
16745 : *
16746 : * return result # <<<<<<<<<<<<<<
16747 : *
16748 : *
16749 : */
16750 0 : __pyx_r = __pyx_v_result;
16751 0 : goto __pyx_L0;
16752 :
16753 : /* "View.MemoryView":1205
16754 : *
16755 : * @cname('__pyx_memoryview_copy_data_to_temp')
16756 : * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16757 : * __Pyx_memviewslice *tmpslice,
16758 : * char order,
16759 : */
16760 :
16761 : /* function exit code */
16762 0 : __pyx_L1_error:;
16763 : #ifdef WITH_THREAD
16764 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16765 : #endif
16766 0 : __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
16767 0 : __pyx_r = NULL;
16768 : #ifdef WITH_THREAD
16769 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
16770 : #endif
16771 0 : __pyx_L0:;
16772 0 : return __pyx_r;
16773 : }
16774 :
16775 : /* "View.MemoryView":1247
16776 : *
16777 : * @cname('__pyx_memoryview_err_extents')
16778 : * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
16779 : * Py_ssize_t extent2) except -1 with gil:
16780 : * raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"
16781 : */
16782 :
16783 0 : static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
16784 0 : int __pyx_r;
16785 : __Pyx_RefNannyDeclarations
16786 0 : PyObject *__pyx_t_1 = NULL;
16787 0 : Py_ssize_t __pyx_t_2;
16788 0 : Py_UCS4 __pyx_t_3;
16789 0 : PyObject *__pyx_t_4 = NULL;
16790 0 : int __pyx_lineno = 0;
16791 0 : const char *__pyx_filename = NULL;
16792 0 : int __pyx_clineno = 0;
16793 : #ifdef WITH_THREAD
16794 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16795 : #endif
16796 0 : __Pyx_RefNannySetupContext("_err_extents", 0);
16797 :
16798 : /* "View.MemoryView":1249
16799 : * cdef int _err_extents(int i, Py_ssize_t extent1,
16800 : * Py_ssize_t extent2) except -1 with gil:
16801 : * raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})" # <<<<<<<<<<<<<<
16802 : *
16803 : * @cname('__pyx_memoryview_err_dim')
16804 : */
16805 0 : __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1249, __pyx_L1_error)
16806 0 : __Pyx_GOTREF(__pyx_t_1);
16807 0 : __pyx_t_2 = 0;
16808 0 : __pyx_t_3 = 127;
16809 0 : __Pyx_INCREF(__pyx_kp_u_got_differing_extents_in_dimensi);
16810 0 : __pyx_t_2 += 35;
16811 0 : __Pyx_GIVEREF(__pyx_kp_u_got_differing_extents_in_dimensi);
16812 0 : PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_got_differing_extents_in_dimensi);
16813 0 : __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
16814 0 : __Pyx_GOTREF(__pyx_t_4);
16815 0 : __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
16816 0 : __Pyx_GIVEREF(__pyx_t_4);
16817 0 : PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
16818 0 : __pyx_t_4 = 0;
16819 0 : __Pyx_INCREF(__pyx_kp_u_got);
16820 0 : __pyx_t_2 += 6;
16821 0 : __Pyx_GIVEREF(__pyx_kp_u_got);
16822 0 : PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_got);
16823 0 : __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent1, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
16824 0 : __Pyx_GOTREF(__pyx_t_4);
16825 0 : __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
16826 0 : __Pyx_GIVEREF(__pyx_t_4);
16827 0 : PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
16828 0 : __pyx_t_4 = 0;
16829 0 : __Pyx_INCREF(__pyx_kp_u_and);
16830 0 : __pyx_t_2 += 5;
16831 0 : __Pyx_GIVEREF(__pyx_kp_u_and);
16832 0 : PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_and);
16833 0 : __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent2, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
16834 0 : __Pyx_GOTREF(__pyx_t_4);
16835 0 : __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
16836 0 : __Pyx_GIVEREF(__pyx_t_4);
16837 0 : PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_4);
16838 0 : __pyx_t_4 = 0;
16839 0 : __Pyx_INCREF(__pyx_kp_u__7);
16840 0 : __pyx_t_2 += 1;
16841 0 : __Pyx_GIVEREF(__pyx_kp_u__7);
16842 0 : PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__7);
16843 0 : __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
16844 0 : __Pyx_GOTREF(__pyx_t_4);
16845 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16846 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_4, 0, 0);
16847 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16848 0 : __PYX_ERR(1, 1249, __pyx_L1_error)
16849 :
16850 : /* "View.MemoryView":1247
16851 : *
16852 : * @cname('__pyx_memoryview_err_extents')
16853 : * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
16854 : * Py_ssize_t extent2) except -1 with gil:
16855 : * raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"
16856 : */
16857 :
16858 : /* function exit code */
16859 0 : __pyx_L1_error:;
16860 0 : __Pyx_XDECREF(__pyx_t_1);
16861 0 : __Pyx_XDECREF(__pyx_t_4);
16862 0 : __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
16863 0 : __pyx_r = -1;
16864 0 : __Pyx_RefNannyFinishContext();
16865 : #ifdef WITH_THREAD
16866 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
16867 : #endif
16868 0 : return __pyx_r;
16869 : }
16870 :
16871 : /* "View.MemoryView":1252
16872 : *
16873 : * @cname('__pyx_memoryview_err_dim')
16874 : * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
16875 : * raise <object>error, msg % dim
16876 : *
16877 : */
16878 :
16879 0 : static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, PyObject *__pyx_v_msg, int __pyx_v_dim) {
16880 0 : int __pyx_r;
16881 : __Pyx_RefNannyDeclarations
16882 0 : PyObject *__pyx_t_1 = NULL;
16883 0 : PyObject *__pyx_t_2 = NULL;
16884 0 : int __pyx_lineno = 0;
16885 0 : const char *__pyx_filename = NULL;
16886 0 : int __pyx_clineno = 0;
16887 : #ifdef WITH_THREAD
16888 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16889 : #endif
16890 0 : __Pyx_RefNannySetupContext("_err_dim", 0);
16891 0 : __Pyx_INCREF(__pyx_v_msg);
16892 :
16893 : /* "View.MemoryView":1253
16894 : * @cname('__pyx_memoryview_err_dim')
16895 : * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil:
16896 : * raise <object>error, msg % dim # <<<<<<<<<<<<<<
16897 : *
16898 : * @cname('__pyx_memoryview_err')
16899 : */
16900 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1253, __pyx_L1_error)
16901 0 : __Pyx_GOTREF(__pyx_t_1);
16902 0 : __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_v_msg, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1253, __pyx_L1_error)
16903 0 : __Pyx_GOTREF(__pyx_t_2);
16904 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16905 0 : __Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_t_2, 0, 0);
16906 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16907 0 : __PYX_ERR(1, 1253, __pyx_L1_error)
16908 :
16909 : /* "View.MemoryView":1252
16910 : *
16911 : * @cname('__pyx_memoryview_err_dim')
16912 : * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
16913 : * raise <object>error, msg % dim
16914 : *
16915 : */
16916 :
16917 : /* function exit code */
16918 0 : __pyx_L1_error:;
16919 0 : __Pyx_XDECREF(__pyx_t_1);
16920 0 : __Pyx_XDECREF(__pyx_t_2);
16921 0 : __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
16922 0 : __pyx_r = -1;
16923 0 : __Pyx_XDECREF(__pyx_v_msg);
16924 0 : __Pyx_RefNannyFinishContext();
16925 : #ifdef WITH_THREAD
16926 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
16927 : #endif
16928 0 : return __pyx_r;
16929 : }
16930 :
16931 : /* "View.MemoryView":1256
16932 : *
16933 : * @cname('__pyx_memoryview_err')
16934 : * cdef int _err(PyObject *error, str msg) except -1 with gil: # <<<<<<<<<<<<<<
16935 : * raise <object>error, msg
16936 : *
16937 : */
16938 :
16939 0 : static int __pyx_memoryview_err(PyObject *__pyx_v_error, PyObject *__pyx_v_msg) {
16940 0 : int __pyx_r;
16941 : __Pyx_RefNannyDeclarations
16942 0 : int __pyx_lineno = 0;
16943 0 : const char *__pyx_filename = NULL;
16944 0 : int __pyx_clineno = 0;
16945 : #ifdef WITH_THREAD
16946 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16947 : #endif
16948 0 : __Pyx_RefNannySetupContext("_err", 0);
16949 0 : __Pyx_INCREF(__pyx_v_msg);
16950 :
16951 : /* "View.MemoryView":1257
16952 : * @cname('__pyx_memoryview_err')
16953 : * cdef int _err(PyObject *error, str msg) except -1 with gil:
16954 : * raise <object>error, msg # <<<<<<<<<<<<<<
16955 : *
16956 : * @cname('__pyx_memoryview_err_no_memory')
16957 : */
16958 0 : __Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_v_msg, 0, 0);
16959 0 : __PYX_ERR(1, 1257, __pyx_L1_error)
16960 :
16961 : /* "View.MemoryView":1256
16962 : *
16963 : * @cname('__pyx_memoryview_err')
16964 : * cdef int _err(PyObject *error, str msg) except -1 with gil: # <<<<<<<<<<<<<<
16965 : * raise <object>error, msg
16966 : *
16967 : */
16968 :
16969 : /* function exit code */
16970 0 : __pyx_L1_error:;
16971 0 : __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
16972 0 : __pyx_r = -1;
16973 0 : __Pyx_XDECREF(__pyx_v_msg);
16974 0 : __Pyx_RefNannyFinishContext();
16975 : #ifdef WITH_THREAD
16976 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
16977 : #endif
16978 0 : return __pyx_r;
16979 : }
16980 :
16981 : /* "View.MemoryView":1260
16982 : *
16983 : * @cname('__pyx_memoryview_err_no_memory')
16984 : * cdef int _err_no_memory() except -1 with gil: # <<<<<<<<<<<<<<
16985 : * raise MemoryError
16986 : *
16987 : */
16988 :
16989 0 : static int __pyx_memoryview_err_no_memory(void) {
16990 0 : int __pyx_r;
16991 0 : int __pyx_lineno = 0;
16992 0 : const char *__pyx_filename = NULL;
16993 0 : int __pyx_clineno = 0;
16994 : #ifdef WITH_THREAD
16995 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16996 : #endif
16997 :
16998 : /* "View.MemoryView":1261
16999 : * @cname('__pyx_memoryview_err_no_memory')
17000 : * cdef int _err_no_memory() except -1 with gil:
17001 : * raise MemoryError # <<<<<<<<<<<<<<
17002 : *
17003 : *
17004 : */
17005 0 : PyErr_NoMemory(); __PYX_ERR(1, 1261, __pyx_L1_error)
17006 :
17007 : /* "View.MemoryView":1260
17008 : *
17009 : * @cname('__pyx_memoryview_err_no_memory')
17010 : * cdef int _err_no_memory() except -1 with gil: # <<<<<<<<<<<<<<
17011 : * raise MemoryError
17012 : *
17013 : */
17014 :
17015 : /* function exit code */
17016 0 : __pyx_L1_error:;
17017 0 : __Pyx_AddTraceback("View.MemoryView._err_no_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
17018 0 : __pyx_r = -1;
17019 : #ifdef WITH_THREAD
17020 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
17021 : #endif
17022 0 : return __pyx_r;
17023 : }
17024 :
17025 : /* "View.MemoryView":1265
17026 : *
17027 : * @cname('__pyx_memoryview_copy_contents')
17028 : * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
17029 : * __Pyx_memviewslice dst,
17030 : * int src_ndim, int dst_ndim,
17031 : */
17032 :
17033 0 : static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
17034 0 : void *__pyx_v_tmpdata;
17035 0 : size_t __pyx_v_itemsize;
17036 0 : int __pyx_v_i;
17037 0 : char __pyx_v_order;
17038 0 : int __pyx_v_broadcasting;
17039 0 : int __pyx_v_direct_copy;
17040 0 : __Pyx_memviewslice __pyx_v_tmp;
17041 0 : int __pyx_v_ndim;
17042 0 : int __pyx_r;
17043 0 : Py_ssize_t __pyx_t_1;
17044 0 : int __pyx_t_2;
17045 0 : int __pyx_t_3;
17046 0 : int __pyx_t_4;
17047 0 : int __pyx_t_5;
17048 0 : int __pyx_t_6;
17049 0 : void *__pyx_t_7;
17050 0 : int __pyx_lineno = 0;
17051 0 : const char *__pyx_filename = NULL;
17052 0 : int __pyx_clineno = 0;
17053 : #ifdef WITH_THREAD
17054 0 : PyGILState_STATE __pyx_gilstate_save;
17055 : #endif
17056 :
17057 : /* "View.MemoryView":1273
17058 : * Check for overlapping memory and verify the shapes.
17059 : * """
17060 : * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
17061 : * cdef size_t itemsize = src.memview.view.itemsize
17062 : * cdef int i
17063 : */
17064 0 : __pyx_v_tmpdata = NULL;
17065 :
17066 : /* "View.MemoryView":1274
17067 : * """
17068 : * cdef void *tmpdata = NULL
17069 : * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
17070 : * cdef int i
17071 : * cdef char order = get_best_order(&src, src_ndim)
17072 : */
17073 0 : __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
17074 0 : __pyx_v_itemsize = __pyx_t_1;
17075 :
17076 : /* "View.MemoryView":1276
17077 : * cdef size_t itemsize = src.memview.view.itemsize
17078 : * cdef int i
17079 : * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
17080 : * cdef bint broadcasting = False
17081 : * cdef bint direct_copy = False
17082 : */
17083 0 : __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
17084 :
17085 : /* "View.MemoryView":1277
17086 : * cdef int i
17087 : * cdef char order = get_best_order(&src, src_ndim)
17088 : * cdef bint broadcasting = False # <<<<<<<<<<<<<<
17089 : * cdef bint direct_copy = False
17090 : * cdef __Pyx_memviewslice tmp
17091 : */
17092 0 : __pyx_v_broadcasting = 0;
17093 :
17094 : /* "View.MemoryView":1278
17095 : * cdef char order = get_best_order(&src, src_ndim)
17096 : * cdef bint broadcasting = False
17097 : * cdef bint direct_copy = False # <<<<<<<<<<<<<<
17098 : * cdef __Pyx_memviewslice tmp
17099 : *
17100 : */
17101 0 : __pyx_v_direct_copy = 0;
17102 :
17103 : /* "View.MemoryView":1281
17104 : * cdef __Pyx_memviewslice tmp
17105 : *
17106 : * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
17107 : * broadcast_leading(&src, src_ndim, dst_ndim)
17108 : * elif dst_ndim < src_ndim:
17109 : */
17110 0 : __pyx_t_2 = (__pyx_v_src_ndim < __pyx_v_dst_ndim);
17111 0 : if (__pyx_t_2) {
17112 :
17113 : /* "View.MemoryView":1282
17114 : *
17115 : * if src_ndim < dst_ndim:
17116 : * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
17117 : * elif dst_ndim < src_ndim:
17118 : * broadcast_leading(&dst, dst_ndim, src_ndim)
17119 : */
17120 0 : __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
17121 :
17122 : /* "View.MemoryView":1281
17123 : * cdef __Pyx_memviewslice tmp
17124 : *
17125 : * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
17126 : * broadcast_leading(&src, src_ndim, dst_ndim)
17127 : * elif dst_ndim < src_ndim:
17128 : */
17129 0 : goto __pyx_L3;
17130 : }
17131 :
17132 : /* "View.MemoryView":1283
17133 : * if src_ndim < dst_ndim:
17134 : * broadcast_leading(&src, src_ndim, dst_ndim)
17135 : * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
17136 : * broadcast_leading(&dst, dst_ndim, src_ndim)
17137 : *
17138 : */
17139 0 : __pyx_t_2 = (__pyx_v_dst_ndim < __pyx_v_src_ndim);
17140 0 : if (__pyx_t_2) {
17141 :
17142 : /* "View.MemoryView":1284
17143 : * broadcast_leading(&src, src_ndim, dst_ndim)
17144 : * elif dst_ndim < src_ndim:
17145 : * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
17146 : *
17147 : * cdef int ndim = max(src_ndim, dst_ndim)
17148 : */
17149 0 : __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
17150 :
17151 : /* "View.MemoryView":1283
17152 : * if src_ndim < dst_ndim:
17153 : * broadcast_leading(&src, src_ndim, dst_ndim)
17154 : * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
17155 : * broadcast_leading(&dst, dst_ndim, src_ndim)
17156 : *
17157 : */
17158 : }
17159 0 : __pyx_L3:;
17160 :
17161 : /* "View.MemoryView":1286
17162 : * broadcast_leading(&dst, dst_ndim, src_ndim)
17163 : *
17164 : * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
17165 : *
17166 : * for i in range(ndim):
17167 : */
17168 0 : __pyx_t_3 = __pyx_v_dst_ndim;
17169 0 : __pyx_t_4 = __pyx_v_src_ndim;
17170 0 : __pyx_t_2 = (__pyx_t_3 > __pyx_t_4);
17171 0 : if (__pyx_t_2) {
17172 : __pyx_t_5 = __pyx_t_3;
17173 : } else {
17174 : __pyx_t_5 = __pyx_t_4;
17175 : }
17176 0 : __pyx_v_ndim = __pyx_t_5;
17177 :
17178 : /* "View.MemoryView":1288
17179 : * cdef int ndim = max(src_ndim, dst_ndim)
17180 : *
17181 : * for i in range(ndim): # <<<<<<<<<<<<<<
17182 : * if src.shape[i] != dst.shape[i]:
17183 : * if src.shape[i] == 1:
17184 : */
17185 0 : __pyx_t_5 = __pyx_v_ndim;
17186 0 : __pyx_t_3 = __pyx_t_5;
17187 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17188 0 : __pyx_v_i = __pyx_t_4;
17189 :
17190 : /* "View.MemoryView":1289
17191 : *
17192 : * for i in range(ndim):
17193 : * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
17194 : * if src.shape[i] == 1:
17195 : * broadcasting = True
17196 : */
17197 0 : __pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i]));
17198 0 : if (__pyx_t_2) {
17199 :
17200 : /* "View.MemoryView":1290
17201 : * for i in range(ndim):
17202 : * if src.shape[i] != dst.shape[i]:
17203 : * if src.shape[i] == 1: # <<<<<<<<<<<<<<
17204 : * broadcasting = True
17205 : * src.strides[i] = 0
17206 : */
17207 0 : __pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) == 1);
17208 0 : if (__pyx_t_2) {
17209 :
17210 : /* "View.MemoryView":1291
17211 : * if src.shape[i] != dst.shape[i]:
17212 : * if src.shape[i] == 1:
17213 : * broadcasting = True # <<<<<<<<<<<<<<
17214 : * src.strides[i] = 0
17215 : * else:
17216 : */
17217 0 : __pyx_v_broadcasting = 1;
17218 :
17219 : /* "View.MemoryView":1292
17220 : * if src.shape[i] == 1:
17221 : * broadcasting = True
17222 : * src.strides[i] = 0 # <<<<<<<<<<<<<<
17223 : * else:
17224 : * _err_extents(i, dst.shape[i], src.shape[i])
17225 : */
17226 0 : (__pyx_v_src.strides[__pyx_v_i]) = 0;
17227 :
17228 : /* "View.MemoryView":1290
17229 : * for i in range(ndim):
17230 : * if src.shape[i] != dst.shape[i]:
17231 : * if src.shape[i] == 1: # <<<<<<<<<<<<<<
17232 : * broadcasting = True
17233 : * src.strides[i] = 0
17234 : */
17235 0 : goto __pyx_L7;
17236 : }
17237 :
17238 : /* "View.MemoryView":1294
17239 : * src.strides[i] = 0
17240 : * else:
17241 : * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
17242 : *
17243 : * if src.suboffsets[i] >= 0:
17244 : */
17245 : /*else*/ {
17246 0 : __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1294, __pyx_L1_error)
17247 : }
17248 0 : __pyx_L7:;
17249 :
17250 : /* "View.MemoryView":1289
17251 : *
17252 : * for i in range(ndim):
17253 : * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
17254 : * if src.shape[i] == 1:
17255 : * broadcasting = True
17256 : */
17257 : }
17258 :
17259 : /* "View.MemoryView":1296
17260 : * _err_extents(i, dst.shape[i], src.shape[i])
17261 : *
17262 : * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
17263 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17264 : *
17265 : */
17266 0 : __pyx_t_2 = ((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0);
17267 0 : if (__pyx_t_2) {
17268 :
17269 : /* "View.MemoryView":1297
17270 : *
17271 : * if src.suboffsets[i] >= 0:
17272 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
17273 : *
17274 : * if slices_overlap(&src, &dst, ndim, itemsize):
17275 : */
17276 0 : __pyx_t_6 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_kp_s_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
17277 :
17278 : /* "View.MemoryView":1296
17279 : * _err_extents(i, dst.shape[i], src.shape[i])
17280 : *
17281 : * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
17282 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17283 : *
17284 : */
17285 : }
17286 : }
17287 :
17288 : /* "View.MemoryView":1299
17289 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17290 : *
17291 : * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
17292 : *
17293 : * if not slice_is_contig(src, order, ndim):
17294 : */
17295 0 : __pyx_t_2 = __pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17296 0 : if (__pyx_t_2) {
17297 :
17298 : /* "View.MemoryView":1301
17299 : * if slices_overlap(&src, &dst, ndim, itemsize):
17300 : *
17301 : * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
17302 : * order = get_best_order(&dst, ndim)
17303 : *
17304 : */
17305 0 : __pyx_t_2 = (!__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim));
17306 0 : if (__pyx_t_2) {
17307 :
17308 : /* "View.MemoryView":1302
17309 : *
17310 : * if not slice_is_contig(src, order, ndim):
17311 : * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
17312 : *
17313 : * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
17314 : */
17315 0 : __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
17316 :
17317 : /* "View.MemoryView":1301
17318 : * if slices_overlap(&src, &dst, ndim, itemsize):
17319 : *
17320 : * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
17321 : * order = get_best_order(&dst, ndim)
17322 : *
17323 : */
17324 : }
17325 :
17326 : /* "View.MemoryView":1304
17327 : * order = get_best_order(&dst, ndim)
17328 : *
17329 : * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
17330 : * src = tmp
17331 : *
17332 : */
17333 0 : __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1304, __pyx_L1_error)
17334 0 : __pyx_v_tmpdata = __pyx_t_7;
17335 :
17336 : /* "View.MemoryView":1305
17337 : *
17338 : * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
17339 : * src = tmp # <<<<<<<<<<<<<<
17340 : *
17341 : * if not broadcasting:
17342 : */
17343 0 : __pyx_v_src = __pyx_v_tmp;
17344 :
17345 : /* "View.MemoryView":1299
17346 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17347 : *
17348 : * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
17349 : *
17350 : * if not slice_is_contig(src, order, ndim):
17351 : */
17352 : }
17353 :
17354 : /* "View.MemoryView":1307
17355 : * src = tmp
17356 : *
17357 : * if not broadcasting: # <<<<<<<<<<<<<<
17358 : *
17359 : *
17360 : */
17361 0 : __pyx_t_2 = (!__pyx_v_broadcasting);
17362 0 : if (__pyx_t_2) {
17363 :
17364 : /* "View.MemoryView":1310
17365 : *
17366 : *
17367 : * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
17368 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17369 : * elif slice_is_contig(src, 'F', ndim):
17370 : */
17371 0 : __pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim);
17372 0 : if (__pyx_t_2) {
17373 :
17374 : /* "View.MemoryView":1311
17375 : *
17376 : * if slice_is_contig(src, 'C', ndim):
17377 : * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
17378 : * elif slice_is_contig(src, 'F', ndim):
17379 : * direct_copy = slice_is_contig(dst, 'F', ndim)
17380 : */
17381 0 : __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
17382 :
17383 : /* "View.MemoryView":1310
17384 : *
17385 : *
17386 : * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
17387 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17388 : * elif slice_is_contig(src, 'F', ndim):
17389 : */
17390 0 : goto __pyx_L12;
17391 : }
17392 :
17393 : /* "View.MemoryView":1312
17394 : * if slice_is_contig(src, 'C', ndim):
17395 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17396 : * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
17397 : * direct_copy = slice_is_contig(dst, 'F', ndim)
17398 : *
17399 : */
17400 0 : __pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim);
17401 0 : if (__pyx_t_2) {
17402 :
17403 : /* "View.MemoryView":1313
17404 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17405 : * elif slice_is_contig(src, 'F', ndim):
17406 : * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
17407 : *
17408 : * if direct_copy:
17409 : */
17410 0 : __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
17411 :
17412 : /* "View.MemoryView":1312
17413 : * if slice_is_contig(src, 'C', ndim):
17414 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17415 : * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
17416 : * direct_copy = slice_is_contig(dst, 'F', ndim)
17417 : *
17418 : */
17419 : }
17420 0 : __pyx_L12:;
17421 :
17422 : /* "View.MemoryView":1315
17423 : * direct_copy = slice_is_contig(dst, 'F', ndim)
17424 : *
17425 : * if direct_copy: # <<<<<<<<<<<<<<
17426 : *
17427 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17428 : */
17429 0 : if (__pyx_v_direct_copy) {
17430 :
17431 : /* "View.MemoryView":1317
17432 : * if direct_copy:
17433 : *
17434 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
17435 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17436 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17437 : */
17438 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17439 :
17440 : /* "View.MemoryView":1318
17441 : *
17442 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17443 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
17444 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17445 : * free(tmpdata)
17446 : */
17447 0 : (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
17448 :
17449 : /* "View.MemoryView":1319
17450 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17451 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17452 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
17453 : * free(tmpdata)
17454 : * return 0
17455 : */
17456 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17457 :
17458 : /* "View.MemoryView":1320
17459 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17460 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17461 : * free(tmpdata) # <<<<<<<<<<<<<<
17462 : * return 0
17463 : *
17464 : */
17465 0 : free(__pyx_v_tmpdata);
17466 :
17467 : /* "View.MemoryView":1321
17468 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17469 : * free(tmpdata)
17470 : * return 0 # <<<<<<<<<<<<<<
17471 : *
17472 : * if order == 'F' == get_best_order(&dst, ndim):
17473 : */
17474 0 : __pyx_r = 0;
17475 0 : goto __pyx_L0;
17476 :
17477 : /* "View.MemoryView":1315
17478 : * direct_copy = slice_is_contig(dst, 'F', ndim)
17479 : *
17480 : * if direct_copy: # <<<<<<<<<<<<<<
17481 : *
17482 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17483 : */
17484 : }
17485 :
17486 : /* "View.MemoryView":1307
17487 : * src = tmp
17488 : *
17489 : * if not broadcasting: # <<<<<<<<<<<<<<
17490 : *
17491 : *
17492 : */
17493 : }
17494 :
17495 : /* "View.MemoryView":1323
17496 : * return 0
17497 : *
17498 : * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
17499 : *
17500 : *
17501 : */
17502 0 : __pyx_t_2 = (__pyx_v_order == 'F');
17503 0 : if (__pyx_t_2) {
17504 0 : __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
17505 : }
17506 0 : if (__pyx_t_2) {
17507 :
17508 : /* "View.MemoryView":1326
17509 : *
17510 : *
17511 : * transpose_memslice(&src) # <<<<<<<<<<<<<<
17512 : * transpose_memslice(&dst)
17513 : *
17514 : */
17515 0 : __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1326, __pyx_L1_error)
17516 :
17517 : /* "View.MemoryView":1327
17518 : *
17519 : * transpose_memslice(&src)
17520 : * transpose_memslice(&dst) # <<<<<<<<<<<<<<
17521 : *
17522 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17523 : */
17524 0 : __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1327, __pyx_L1_error)
17525 :
17526 : /* "View.MemoryView":1323
17527 : * return 0
17528 : *
17529 : * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
17530 : *
17531 : *
17532 : */
17533 : }
17534 :
17535 : /* "View.MemoryView":1329
17536 : * transpose_memslice(&dst)
17537 : *
17538 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
17539 : * copy_strided_to_strided(&src, &dst, ndim, itemsize)
17540 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17541 : */
17542 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17543 :
17544 : /* "View.MemoryView":1330
17545 : *
17546 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17547 : * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
17548 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17549 : *
17550 : */
17551 0 : copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17552 :
17553 : /* "View.MemoryView":1331
17554 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17555 : * copy_strided_to_strided(&src, &dst, ndim, itemsize)
17556 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
17557 : *
17558 : * free(tmpdata)
17559 : */
17560 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17561 :
17562 : /* "View.MemoryView":1333
17563 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17564 : *
17565 : * free(tmpdata) # <<<<<<<<<<<<<<
17566 : * return 0
17567 : *
17568 : */
17569 0 : free(__pyx_v_tmpdata);
17570 :
17571 : /* "View.MemoryView":1334
17572 : *
17573 : * free(tmpdata)
17574 : * return 0 # <<<<<<<<<<<<<<
17575 : *
17576 : * @cname('__pyx_memoryview_broadcast_leading')
17577 : */
17578 0 : __pyx_r = 0;
17579 0 : goto __pyx_L0;
17580 :
17581 : /* "View.MemoryView":1265
17582 : *
17583 : * @cname('__pyx_memoryview_copy_contents')
17584 : * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
17585 : * __Pyx_memviewslice dst,
17586 : * int src_ndim, int dst_ndim,
17587 : */
17588 :
17589 : /* function exit code */
17590 0 : __pyx_L1_error:;
17591 : #ifdef WITH_THREAD
17592 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17593 : #endif
17594 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
17595 0 : __pyx_r = -1;
17596 : #ifdef WITH_THREAD
17597 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
17598 : #endif
17599 0 : __pyx_L0:;
17600 0 : return __pyx_r;
17601 : }
17602 :
17603 : /* "View.MemoryView":1337
17604 : *
17605 : * @cname('__pyx_memoryview_broadcast_leading')
17606 : * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
17607 : * int ndim,
17608 : * int ndim_other) noexcept nogil:
17609 : */
17610 :
17611 0 : static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
17612 0 : int __pyx_v_i;
17613 0 : int __pyx_v_offset;
17614 0 : int __pyx_t_1;
17615 0 : int __pyx_t_2;
17616 0 : int __pyx_t_3;
17617 :
17618 : /* "View.MemoryView":1341
17619 : * int ndim_other) noexcept nogil:
17620 : * cdef int i
17621 : * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
17622 : *
17623 : * for i in range(ndim - 1, -1, -1):
17624 : */
17625 0 : __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
17626 :
17627 : /* "View.MemoryView":1343
17628 : * cdef int offset = ndim_other - ndim
17629 : *
17630 : * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
17631 : * mslice.shape[i + offset] = mslice.shape[i]
17632 : * mslice.strides[i + offset] = mslice.strides[i]
17633 : */
17634 0 : for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
17635 0 : __pyx_v_i = __pyx_t_1;
17636 :
17637 : /* "View.MemoryView":1344
17638 : *
17639 : * for i in range(ndim - 1, -1, -1):
17640 : * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
17641 : * mslice.strides[i + offset] = mslice.strides[i]
17642 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17643 : */
17644 0 : (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
17645 :
17646 : /* "View.MemoryView":1345
17647 : * for i in range(ndim - 1, -1, -1):
17648 : * mslice.shape[i + offset] = mslice.shape[i]
17649 : * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
17650 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17651 : *
17652 : */
17653 0 : (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
17654 :
17655 : /* "View.MemoryView":1346
17656 : * mslice.shape[i + offset] = mslice.shape[i]
17657 : * mslice.strides[i + offset] = mslice.strides[i]
17658 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
17659 : *
17660 : * for i in range(offset):
17661 : */
17662 0 : (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
17663 : }
17664 :
17665 : /* "View.MemoryView":1348
17666 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17667 : *
17668 : * for i in range(offset): # <<<<<<<<<<<<<<
17669 : * mslice.shape[i] = 1
17670 : * mslice.strides[i] = mslice.strides[0]
17671 : */
17672 0 : __pyx_t_1 = __pyx_v_offset;
17673 : __pyx_t_2 = __pyx_t_1;
17674 0 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17675 0 : __pyx_v_i = __pyx_t_3;
17676 :
17677 : /* "View.MemoryView":1349
17678 : *
17679 : * for i in range(offset):
17680 : * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
17681 : * mslice.strides[i] = mslice.strides[0]
17682 : * mslice.suboffsets[i] = -1
17683 : */
17684 0 : (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
17685 :
17686 : /* "View.MemoryView":1350
17687 : * for i in range(offset):
17688 : * mslice.shape[i] = 1
17689 : * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
17690 : * mslice.suboffsets[i] = -1
17691 : *
17692 : */
17693 0 : (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
17694 :
17695 : /* "View.MemoryView":1351
17696 : * mslice.shape[i] = 1
17697 : * mslice.strides[i] = mslice.strides[0]
17698 : * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
17699 : *
17700 : *
17701 : */
17702 0 : (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
17703 : }
17704 :
17705 : /* "View.MemoryView":1337
17706 : *
17707 : * @cname('__pyx_memoryview_broadcast_leading')
17708 : * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
17709 : * int ndim,
17710 : * int ndim_other) noexcept nogil:
17711 : */
17712 :
17713 : /* function exit code */
17714 0 : }
17715 :
17716 : /* "View.MemoryView":1359
17717 : *
17718 : * @cname('__pyx_memoryview_refcount_copying')
17719 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil: # <<<<<<<<<<<<<<
17720 : *
17721 : * if dtype_is_object:
17722 : */
17723 :
17724 0 : static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
17725 :
17726 : /* "View.MemoryView":1361
17727 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
17728 : *
17729 : * if dtype_is_object: # <<<<<<<<<<<<<<
17730 : * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
17731 : *
17732 : */
17733 0 : if (__pyx_v_dtype_is_object) {
17734 :
17735 : /* "View.MemoryView":1362
17736 : *
17737 : * if dtype_is_object:
17738 : * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc) # <<<<<<<<<<<<<<
17739 : *
17740 : * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
17741 : */
17742 0 : __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
17743 :
17744 : /* "View.MemoryView":1361
17745 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
17746 : *
17747 : * if dtype_is_object: # <<<<<<<<<<<<<<
17748 : * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
17749 : *
17750 : */
17751 : }
17752 :
17753 : /* "View.MemoryView":1359
17754 : *
17755 : * @cname('__pyx_memoryview_refcount_copying')
17756 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil: # <<<<<<<<<<<<<<
17757 : *
17758 : * if dtype_is_object:
17759 : */
17760 :
17761 : /* function exit code */
17762 0 : }
17763 :
17764 : /* "View.MemoryView":1365
17765 : *
17766 : * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
17767 : * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17768 : * Py_ssize_t *strides, int ndim,
17769 : * bint inc) noexcept with gil:
17770 : */
17771 :
17772 0 : static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
17773 : #ifdef WITH_THREAD
17774 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17775 : #endif
17776 :
17777 : /* "View.MemoryView":1368
17778 : * Py_ssize_t *strides, int ndim,
17779 : * bint inc) noexcept with gil:
17780 : * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
17781 : *
17782 : * @cname('__pyx_memoryview_refcount_objects_in_slice')
17783 : */
17784 0 : __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
17785 :
17786 : /* "View.MemoryView":1365
17787 : *
17788 : * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
17789 : * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17790 : * Py_ssize_t *strides, int ndim,
17791 : * bint inc) noexcept with gil:
17792 : */
17793 :
17794 : /* function exit code */
17795 : #ifdef WITH_THREAD
17796 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
17797 : #endif
17798 0 : }
17799 :
17800 : /* "View.MemoryView":1371
17801 : *
17802 : * @cname('__pyx_memoryview_refcount_objects_in_slice')
17803 : * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17804 : * Py_ssize_t *strides, int ndim, bint inc) noexcept:
17805 : * cdef Py_ssize_t i
17806 : */
17807 :
17808 0 : static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
17809 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_i;
17810 0 : Py_ssize_t __pyx_v_stride;
17811 0 : Py_ssize_t __pyx_t_1;
17812 0 : Py_ssize_t __pyx_t_2;
17813 0 : Py_ssize_t __pyx_t_3;
17814 0 : int __pyx_t_4;
17815 :
17816 : /* "View.MemoryView":1374
17817 : * Py_ssize_t *strides, int ndim, bint inc) noexcept:
17818 : * cdef Py_ssize_t i
17819 : * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
17820 : *
17821 : * for i in range(shape[0]):
17822 : */
17823 0 : __pyx_v_stride = (__pyx_v_strides[0]);
17824 :
17825 : /* "View.MemoryView":1376
17826 : * cdef Py_ssize_t stride = strides[0]
17827 : *
17828 : * for i in range(shape[0]): # <<<<<<<<<<<<<<
17829 : * if ndim == 1:
17830 : * if inc:
17831 : */
17832 0 : __pyx_t_1 = (__pyx_v_shape[0]);
17833 0 : __pyx_t_2 = __pyx_t_1;
17834 0 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17835 0 : __pyx_v_i = __pyx_t_3;
17836 :
17837 : /* "View.MemoryView":1377
17838 : *
17839 : * for i in range(shape[0]):
17840 : * if ndim == 1: # <<<<<<<<<<<<<<
17841 : * if inc:
17842 : * Py_INCREF((<PyObject **> data)[0])
17843 : */
17844 0 : __pyx_t_4 = (__pyx_v_ndim == 1);
17845 0 : if (__pyx_t_4) {
17846 :
17847 : /* "View.MemoryView":1378
17848 : * for i in range(shape[0]):
17849 : * if ndim == 1:
17850 : * if inc: # <<<<<<<<<<<<<<
17851 : * Py_INCREF((<PyObject **> data)[0])
17852 : * else:
17853 : */
17854 0 : if (__pyx_v_inc) {
17855 :
17856 : /* "View.MemoryView":1379
17857 : * if ndim == 1:
17858 : * if inc:
17859 : * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
17860 : * else:
17861 : * Py_DECREF((<PyObject **> data)[0])
17862 : */
17863 0 : Py_INCREF((((PyObject **)__pyx_v_data)[0]));
17864 :
17865 : /* "View.MemoryView":1378
17866 : * for i in range(shape[0]):
17867 : * if ndim == 1:
17868 : * if inc: # <<<<<<<<<<<<<<
17869 : * Py_INCREF((<PyObject **> data)[0])
17870 : * else:
17871 : */
17872 0 : goto __pyx_L6;
17873 : }
17874 :
17875 : /* "View.MemoryView":1381
17876 : * Py_INCREF((<PyObject **> data)[0])
17877 : * else:
17878 : * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
17879 : * else:
17880 : * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
17881 : */
17882 : /*else*/ {
17883 0 : Py_DECREF((((PyObject **)__pyx_v_data)[0]));
17884 : }
17885 0 : __pyx_L6:;
17886 :
17887 : /* "View.MemoryView":1377
17888 : *
17889 : * for i in range(shape[0]):
17890 : * if ndim == 1: # <<<<<<<<<<<<<<
17891 : * if inc:
17892 : * Py_INCREF((<PyObject **> data)[0])
17893 : */
17894 0 : goto __pyx_L5;
17895 : }
17896 :
17897 : /* "View.MemoryView":1383
17898 : * Py_DECREF((<PyObject **> data)[0])
17899 : * else:
17900 : * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc) # <<<<<<<<<<<<<<
17901 : *
17902 : * data += stride
17903 : */
17904 : /*else*/ {
17905 0 : __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
17906 : }
17907 0 : __pyx_L5:;
17908 :
17909 : /* "View.MemoryView":1385
17910 : * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
17911 : *
17912 : * data += stride # <<<<<<<<<<<<<<
17913 : *
17914 : *
17915 : */
17916 0 : __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
17917 : }
17918 :
17919 : /* "View.MemoryView":1371
17920 : *
17921 : * @cname('__pyx_memoryview_refcount_objects_in_slice')
17922 : * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17923 : * Py_ssize_t *strides, int ndim, bint inc) noexcept:
17924 : * cdef Py_ssize_t i
17925 : */
17926 :
17927 : /* function exit code */
17928 0 : }
17929 :
17930 : /* "View.MemoryView":1391
17931 : *
17932 : * @cname('__pyx_memoryview_slice_assign_scalar')
17933 : * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
17934 : * size_t itemsize, void *item,
17935 : * bint dtype_is_object) noexcept nogil:
17936 : */
17937 :
17938 0 : static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
17939 :
17940 : /* "View.MemoryView":1394
17941 : * size_t itemsize, void *item,
17942 : * bint dtype_is_object) noexcept nogil:
17943 : * refcount_copying(dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
17944 : * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
17945 : * refcount_copying(dst, dtype_is_object, ndim, inc=True)
17946 : */
17947 0 : __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17948 :
17949 : /* "View.MemoryView":1395
17950 : * bint dtype_is_object) noexcept nogil:
17951 : * refcount_copying(dst, dtype_is_object, ndim, inc=False)
17952 : * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item) # <<<<<<<<<<<<<<
17953 : * refcount_copying(dst, dtype_is_object, ndim, inc=True)
17954 : *
17955 : */
17956 0 : __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
17957 :
17958 : /* "View.MemoryView":1396
17959 : * refcount_copying(dst, dtype_is_object, ndim, inc=False)
17960 : * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
17961 : * refcount_copying(dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
17962 : *
17963 : *
17964 : */
17965 0 : __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17966 :
17967 : /* "View.MemoryView":1391
17968 : *
17969 : * @cname('__pyx_memoryview_slice_assign_scalar')
17970 : * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
17971 : * size_t itemsize, void *item,
17972 : * bint dtype_is_object) noexcept nogil:
17973 : */
17974 :
17975 : /* function exit code */
17976 0 : }
17977 :
17978 : /* "View.MemoryView":1400
17979 : *
17980 : * @cname('__pyx_memoryview__slice_assign_scalar')
17981 : * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17982 : * Py_ssize_t *strides, int ndim,
17983 : * size_t itemsize, void *item) noexcept nogil:
17984 : */
17985 :
17986 0 : static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
17987 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_i;
17988 0 : Py_ssize_t __pyx_v_stride;
17989 0 : Py_ssize_t __pyx_v_extent;
17990 0 : int __pyx_t_1;
17991 0 : Py_ssize_t __pyx_t_2;
17992 0 : Py_ssize_t __pyx_t_3;
17993 0 : Py_ssize_t __pyx_t_4;
17994 :
17995 : /* "View.MemoryView":1404
17996 : * size_t itemsize, void *item) noexcept nogil:
17997 : * cdef Py_ssize_t i
17998 : * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
17999 : * cdef Py_ssize_t extent = shape[0]
18000 : *
18001 : */
18002 0 : __pyx_v_stride = (__pyx_v_strides[0]);
18003 :
18004 : /* "View.MemoryView":1405
18005 : * cdef Py_ssize_t i
18006 : * cdef Py_ssize_t stride = strides[0]
18007 : * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
18008 : *
18009 : * if ndim == 1:
18010 : */
18011 0 : __pyx_v_extent = (__pyx_v_shape[0]);
18012 :
18013 : /* "View.MemoryView":1407
18014 : * cdef Py_ssize_t extent = shape[0]
18015 : *
18016 : * if ndim == 1: # <<<<<<<<<<<<<<
18017 : * for i in range(extent):
18018 : * memcpy(data, item, itemsize)
18019 : */
18020 0 : __pyx_t_1 = (__pyx_v_ndim == 1);
18021 0 : if (__pyx_t_1) {
18022 :
18023 : /* "View.MemoryView":1408
18024 : *
18025 : * if ndim == 1:
18026 : * for i in range(extent): # <<<<<<<<<<<<<<
18027 : * memcpy(data, item, itemsize)
18028 : * data += stride
18029 : */
18030 : __pyx_t_2 = __pyx_v_extent;
18031 : __pyx_t_3 = __pyx_t_2;
18032 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18033 0 : __pyx_v_i = __pyx_t_4;
18034 :
18035 : /* "View.MemoryView":1409
18036 : * if ndim == 1:
18037 : * for i in range(extent):
18038 : * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
18039 : * data += stride
18040 : * else:
18041 : */
18042 0 : (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
18043 :
18044 : /* "View.MemoryView":1410
18045 : * for i in range(extent):
18046 : * memcpy(data, item, itemsize)
18047 : * data += stride # <<<<<<<<<<<<<<
18048 : * else:
18049 : * for i in range(extent):
18050 : */
18051 0 : __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18052 : }
18053 :
18054 : /* "View.MemoryView":1407
18055 : * cdef Py_ssize_t extent = shape[0]
18056 : *
18057 : * if ndim == 1: # <<<<<<<<<<<<<<
18058 : * for i in range(extent):
18059 : * memcpy(data, item, itemsize)
18060 : */
18061 0 : goto __pyx_L3;
18062 : }
18063 :
18064 : /* "View.MemoryView":1412
18065 : * data += stride
18066 : * else:
18067 : * for i in range(extent): # <<<<<<<<<<<<<<
18068 : * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
18069 : * data += stride
18070 : */
18071 : /*else*/ {
18072 : __pyx_t_2 = __pyx_v_extent;
18073 : __pyx_t_3 = __pyx_t_2;
18074 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18075 0 : __pyx_v_i = __pyx_t_4;
18076 :
18077 : /* "View.MemoryView":1413
18078 : * else:
18079 : * for i in range(extent):
18080 : * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item) # <<<<<<<<<<<<<<
18081 : * data += stride
18082 : *
18083 : */
18084 0 : __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
18085 :
18086 : /* "View.MemoryView":1414
18087 : * for i in range(extent):
18088 : * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
18089 : * data += stride # <<<<<<<<<<<<<<
18090 : *
18091 : *
18092 : */
18093 0 : __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18094 : }
18095 : }
18096 0 : __pyx_L3:;
18097 :
18098 : /* "View.MemoryView":1400
18099 : *
18100 : * @cname('__pyx_memoryview__slice_assign_scalar')
18101 : * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
18102 : * Py_ssize_t *strides, int ndim,
18103 : * size_t itemsize, void *item) noexcept nogil:
18104 : */
18105 :
18106 : /* function exit code */
18107 0 : }
18108 :
18109 : /* "(tree fragment)":1
18110 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
18111 : * cdef object __pyx_PickleError
18112 : * cdef object __pyx_result
18113 : */
18114 :
18115 : /* Python wrapper */
18116 : static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
18117 : #if CYTHON_METH_FASTCALL
18118 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18119 : #else
18120 : PyObject *__pyx_args, PyObject *__pyx_kwds
18121 : #endif
18122 : ); /*proto*/
18123 : static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
18124 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
18125 : #if CYTHON_METH_FASTCALL
18126 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18127 : #else
18128 : PyObject *__pyx_args, PyObject *__pyx_kwds
18129 : #endif
18130 : ) {
18131 0 : PyObject *__pyx_v___pyx_type = 0;
18132 0 : long __pyx_v___pyx_checksum;
18133 0 : PyObject *__pyx_v___pyx_state = 0;
18134 : #if !CYTHON_METH_FASTCALL
18135 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
18136 : #endif
18137 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
18138 0 : PyObject* values[3] = {0,0,0};
18139 0 : int __pyx_lineno = 0;
18140 0 : const char *__pyx_filename = NULL;
18141 0 : int __pyx_clineno = 0;
18142 0 : PyObject *__pyx_r = 0;
18143 : __Pyx_RefNannyDeclarations
18144 0 : __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
18145 : #if !CYTHON_METH_FASTCALL
18146 : #if CYTHON_ASSUME_SAFE_MACROS
18147 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
18148 : #else
18149 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
18150 : #endif
18151 : #endif
18152 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
18153 : {
18154 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
18155 0 : if (__pyx_kwds) {
18156 0 : Py_ssize_t kw_args;
18157 0 : switch (__pyx_nargs) {
18158 0 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
18159 0 : CYTHON_FALLTHROUGH;
18160 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
18161 0 : CYTHON_FALLTHROUGH;
18162 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
18163 0 : CYTHON_FALLTHROUGH;
18164 0 : case 0: break;
18165 0 : default: goto __pyx_L5_argtuple_error;
18166 : }
18167 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
18168 0 : switch (__pyx_nargs) {
18169 0 : case 0:
18170 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) {
18171 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
18172 0 : kw_args--;
18173 : }
18174 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
18175 0 : else goto __pyx_L5_argtuple_error;
18176 0 : CYTHON_FALLTHROUGH;
18177 : case 1:
18178 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) {
18179 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
18180 0 : kw_args--;
18181 : }
18182 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
18183 : else {
18184 0 : __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
18185 : }
18186 0 : CYTHON_FALLTHROUGH;
18187 : case 2:
18188 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
18189 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
18190 0 : kw_args--;
18191 : }
18192 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
18193 : else {
18194 0 : __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
18195 : }
18196 : }
18197 0 : if (unlikely(kw_args > 0)) {
18198 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
18199 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
18200 : }
18201 0 : } else if (unlikely(__pyx_nargs != 3)) {
18202 0 : goto __pyx_L5_argtuple_error;
18203 : } else {
18204 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
18205 0 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
18206 0 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
18207 : }
18208 0 : __pyx_v___pyx_type = values[0];
18209 0 : __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
18210 0 : __pyx_v___pyx_state = values[2];
18211 : }
18212 0 : goto __pyx_L6_skip;
18213 0 : __pyx_L5_argtuple_error:;
18214 0 : __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error)
18215 0 : __pyx_L6_skip:;
18216 0 : goto __pyx_L4_argument_unpacking_done;
18217 0 : __pyx_L3_error:;
18218 : {
18219 0 : Py_ssize_t __pyx_temp;
18220 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18221 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
18222 : }
18223 : }
18224 0 : __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18225 0 : __Pyx_RefNannyFinishContext();
18226 0 : return NULL;
18227 0 : __pyx_L4_argument_unpacking_done:;
18228 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
18229 :
18230 : /* function exit code */
18231 : {
18232 0 : Py_ssize_t __pyx_temp;
18233 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18234 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
18235 : }
18236 : }
18237 : __Pyx_RefNannyFinishContext();
18238 : return __pyx_r;
18239 : }
18240 :
18241 0 : static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
18242 0 : PyObject *__pyx_v___pyx_PickleError = 0;
18243 0 : PyObject *__pyx_v___pyx_result = 0;
18244 0 : PyObject *__pyx_r = NULL;
18245 : __Pyx_RefNannyDeclarations
18246 0 : PyObject *__pyx_t_1 = NULL;
18247 0 : int __pyx_t_2;
18248 0 : PyObject *__pyx_t_3 = NULL;
18249 0 : PyObject *__pyx_t_4 = NULL;
18250 0 : unsigned int __pyx_t_5;
18251 0 : int __pyx_lineno = 0;
18252 0 : const char *__pyx_filename = NULL;
18253 0 : int __pyx_clineno = 0;
18254 0 : __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 1);
18255 :
18256 : /* "(tree fragment)":4
18257 : * cdef object __pyx_PickleError
18258 : * cdef object __pyx_result
18259 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<<
18260 : * from pickle import PickleError as __pyx_PickleError
18261 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18262 : */
18263 0 : __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
18264 0 : __Pyx_GOTREF(__pyx_t_1);
18265 0 : __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__8, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error)
18266 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18267 0 : if (__pyx_t_2) {
18268 :
18269 : /* "(tree fragment)":5
18270 : * cdef object __pyx_result
18271 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):
18272 : * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
18273 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18274 : * __pyx_result = Enum.__new__(__pyx_type)
18275 : */
18276 0 : __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
18277 0 : __Pyx_GOTREF(__pyx_t_1);
18278 0 : __Pyx_INCREF(__pyx_n_s_PickleError);
18279 0 : __Pyx_GIVEREF(__pyx_n_s_PickleError);
18280 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(1, 5, __pyx_L1_error);
18281 0 : __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
18282 0 : __Pyx_GOTREF(__pyx_t_3);
18283 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18284 0 : __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
18285 0 : __Pyx_GOTREF(__pyx_t_1);
18286 0 : __Pyx_INCREF(__pyx_t_1);
18287 0 : __pyx_v___pyx_PickleError = __pyx_t_1;
18288 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18289 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18290 :
18291 : /* "(tree fragment)":6
18292 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):
18293 : * from pickle import PickleError as __pyx_PickleError
18294 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum # <<<<<<<<<<<<<<
18295 : * __pyx_result = Enum.__new__(__pyx_type)
18296 : * if __pyx_state is not None:
18297 : */
18298 0 : __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
18299 0 : __Pyx_GOTREF(__pyx_t_3);
18300 0 : __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
18301 0 : __Pyx_GOTREF(__pyx_t_1);
18302 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18303 0 : __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
18304 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18305 0 : __PYX_ERR(1, 6, __pyx_L1_error)
18306 :
18307 : /* "(tree fragment)":4
18308 : * cdef object __pyx_PickleError
18309 : * cdef object __pyx_result
18310 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<<
18311 : * from pickle import PickleError as __pyx_PickleError
18312 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18313 : */
18314 : }
18315 :
18316 : /* "(tree fragment)":7
18317 : * from pickle import PickleError as __pyx_PickleError
18318 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18319 : * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
18320 : * if __pyx_state is not None:
18321 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18322 : */
18323 0 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
18324 0 : __Pyx_GOTREF(__pyx_t_3);
18325 0 : __pyx_t_4 = NULL;
18326 0 : __pyx_t_5 = 0;
18327 : #if CYTHON_UNPACK_METHODS
18328 0 : if (likely(PyMethod_Check(__pyx_t_3))) {
18329 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
18330 0 : if (likely(__pyx_t_4)) {
18331 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
18332 0 : __Pyx_INCREF(__pyx_t_4);
18333 0 : __Pyx_INCREF(function);
18334 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
18335 : __pyx_t_5 = 1;
18336 : }
18337 : }
18338 : #endif
18339 : {
18340 0 : PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type};
18341 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
18342 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
18343 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
18344 0 : __Pyx_GOTREF(__pyx_t_1);
18345 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18346 : }
18347 0 : __pyx_v___pyx_result = __pyx_t_1;
18348 0 : __pyx_t_1 = 0;
18349 :
18350 : /* "(tree fragment)":8
18351 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18352 : * __pyx_result = Enum.__new__(__pyx_type)
18353 : * if __pyx_state is not None: # <<<<<<<<<<<<<<
18354 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18355 : * return __pyx_result
18356 : */
18357 0 : __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
18358 0 : if (__pyx_t_2) {
18359 :
18360 : /* "(tree fragment)":9
18361 : * __pyx_result = Enum.__new__(__pyx_type)
18362 : * if __pyx_state is not None:
18363 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
18364 : * return __pyx_result
18365 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18366 : */
18367 0 : if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error)
18368 0 : __pyx_t_1 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
18369 0 : __Pyx_GOTREF(__pyx_t_1);
18370 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18371 :
18372 : /* "(tree fragment)":8
18373 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18374 : * __pyx_result = Enum.__new__(__pyx_type)
18375 : * if __pyx_state is not None: # <<<<<<<<<<<<<<
18376 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18377 : * return __pyx_result
18378 : */
18379 : }
18380 :
18381 : /* "(tree fragment)":10
18382 : * if __pyx_state is not None:
18383 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18384 : * return __pyx_result # <<<<<<<<<<<<<<
18385 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18386 : * __pyx_result.name = __pyx_state[0]
18387 : */
18388 0 : __Pyx_XDECREF(__pyx_r);
18389 0 : __Pyx_INCREF(__pyx_v___pyx_result);
18390 0 : __pyx_r = __pyx_v___pyx_result;
18391 0 : goto __pyx_L0;
18392 :
18393 : /* "(tree fragment)":1
18394 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
18395 : * cdef object __pyx_PickleError
18396 : * cdef object __pyx_result
18397 : */
18398 :
18399 : /* function exit code */
18400 0 : __pyx_L1_error:;
18401 0 : __Pyx_XDECREF(__pyx_t_1);
18402 0 : __Pyx_XDECREF(__pyx_t_3);
18403 0 : __Pyx_XDECREF(__pyx_t_4);
18404 0 : __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18405 0 : __pyx_r = NULL;
18406 0 : __pyx_L0:;
18407 0 : __Pyx_XDECREF(__pyx_v___pyx_PickleError);
18408 0 : __Pyx_XDECREF(__pyx_v___pyx_result);
18409 0 : __Pyx_XGIVEREF(__pyx_r);
18410 0 : __Pyx_RefNannyFinishContext();
18411 0 : return __pyx_r;
18412 : }
18413 :
18414 : /* "(tree fragment)":11
18415 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18416 : * return __pyx_result
18417 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
18418 : * __pyx_result.name = __pyx_state[0]
18419 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
18420 : */
18421 :
18422 0 : static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
18423 0 : PyObject *__pyx_r = NULL;
18424 : __Pyx_RefNannyDeclarations
18425 0 : PyObject *__pyx_t_1 = NULL;
18426 0 : int __pyx_t_2;
18427 0 : Py_ssize_t __pyx_t_3;
18428 0 : int __pyx_t_4;
18429 0 : PyObject *__pyx_t_5 = NULL;
18430 0 : PyObject *__pyx_t_6 = NULL;
18431 0 : PyObject *__pyx_t_7 = NULL;
18432 0 : unsigned int __pyx_t_8;
18433 0 : int __pyx_lineno = 0;
18434 0 : const char *__pyx_filename = NULL;
18435 0 : int __pyx_clineno = 0;
18436 0 : __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 1);
18437 :
18438 : /* "(tree fragment)":12
18439 : * return __pyx_result
18440 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18441 : * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
18442 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
18443 : * __pyx_result.__dict__.update(__pyx_state[1])
18444 : */
18445 0 : if (unlikely(__pyx_v___pyx_state == Py_None)) {
18446 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18447 0 : __PYX_ERR(1, 12, __pyx_L1_error)
18448 : }
18449 0 : __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
18450 0 : __Pyx_GOTREF(__pyx_t_1);
18451 0 : __Pyx_GIVEREF(__pyx_t_1);
18452 0 : __Pyx_GOTREF(__pyx_v___pyx_result->name);
18453 0 : __Pyx_DECREF(__pyx_v___pyx_result->name);
18454 0 : __pyx_v___pyx_result->name = __pyx_t_1;
18455 0 : __pyx_t_1 = 0;
18456 :
18457 : /* "(tree fragment)":13
18458 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18459 : * __pyx_result.name = __pyx_state[0]
18460 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
18461 : * __pyx_result.__dict__.update(__pyx_state[1])
18462 : */
18463 0 : if (unlikely(__pyx_v___pyx_state == Py_None)) {
18464 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
18465 : __PYX_ERR(1, 13, __pyx_L1_error)
18466 : }
18467 0 : __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
18468 0 : __pyx_t_4 = (__pyx_t_3 > 1);
18469 0 : if (__pyx_t_4) {
18470 0 : } else {
18471 0 : __pyx_t_2 = __pyx_t_4;
18472 0 : goto __pyx_L4_bool_binop_done;
18473 : }
18474 0 : __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
18475 : __pyx_t_2 = __pyx_t_4;
18476 0 : __pyx_L4_bool_binop_done:;
18477 0 : if (__pyx_t_2) {
18478 :
18479 : /* "(tree fragment)":14
18480 : * __pyx_result.name = __pyx_state[0]
18481 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
18482 : * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
18483 : */
18484 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
18485 0 : __Pyx_GOTREF(__pyx_t_5);
18486 0 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
18487 0 : __Pyx_GOTREF(__pyx_t_6);
18488 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18489 0 : if (unlikely(__pyx_v___pyx_state == Py_None)) {
18490 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18491 : __PYX_ERR(1, 14, __pyx_L1_error)
18492 : }
18493 0 : __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
18494 0 : __Pyx_GOTREF(__pyx_t_5);
18495 0 : __pyx_t_7 = NULL;
18496 0 : __pyx_t_8 = 0;
18497 : #if CYTHON_UNPACK_METHODS
18498 0 : if (likely(PyMethod_Check(__pyx_t_6))) {
18499 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
18500 0 : if (likely(__pyx_t_7)) {
18501 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
18502 0 : __Pyx_INCREF(__pyx_t_7);
18503 0 : __Pyx_INCREF(function);
18504 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
18505 : __pyx_t_8 = 1;
18506 : }
18507 : }
18508 : #endif
18509 : {
18510 0 : PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5};
18511 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
18512 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
18513 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18514 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
18515 0 : __Pyx_GOTREF(__pyx_t_1);
18516 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18517 : }
18518 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18519 :
18520 : /* "(tree fragment)":13
18521 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18522 : * __pyx_result.name = __pyx_state[0]
18523 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
18524 : * __pyx_result.__dict__.update(__pyx_state[1])
18525 : */
18526 : }
18527 :
18528 : /* "(tree fragment)":11
18529 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18530 : * return __pyx_result
18531 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
18532 : * __pyx_result.name = __pyx_state[0]
18533 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
18534 : */
18535 :
18536 : /* function exit code */
18537 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18538 0 : goto __pyx_L0;
18539 0 : __pyx_L1_error:;
18540 0 : __Pyx_XDECREF(__pyx_t_1);
18541 0 : __Pyx_XDECREF(__pyx_t_5);
18542 0 : __Pyx_XDECREF(__pyx_t_6);
18543 0 : __Pyx_XDECREF(__pyx_t_7);
18544 0 : __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
18545 0 : __pyx_r = 0;
18546 0 : __pyx_L0:;
18547 0 : __Pyx_XGIVEREF(__pyx_r);
18548 0 : __Pyx_RefNannyFinishContext();
18549 0 : return __pyx_r;
18550 : }
18551 :
18552 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":286
18553 : *
18554 : * @property
18555 : * cdef inline npy_intp itemsize(self) noexcept nogil: # <<<<<<<<<<<<<<
18556 : * return PyDataType_ELSIZE(self)
18557 : *
18558 : */
18559 :
18560 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self) {
18561 : npy_intp __pyx_r;
18562 :
18563 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":287
18564 : * @property
18565 : * cdef inline npy_intp itemsize(self) noexcept nogil:
18566 : * return PyDataType_ELSIZE(self) # <<<<<<<<<<<<<<
18567 : *
18568 : * @property
18569 : */
18570 : __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
18571 : goto __pyx_L0;
18572 :
18573 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":286
18574 : *
18575 : * @property
18576 : * cdef inline npy_intp itemsize(self) noexcept nogil: # <<<<<<<<<<<<<<
18577 : * return PyDataType_ELSIZE(self)
18578 : *
18579 : */
18580 :
18581 : /* function exit code */
18582 : __pyx_L0:;
18583 : return __pyx_r;
18584 : }
18585 :
18586 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290
18587 : *
18588 : * @property
18589 : * cdef inline npy_intp alignment(self) noexcept nogil: # <<<<<<<<<<<<<<
18590 : * return PyDataType_ALIGNMENT(self)
18591 : *
18592 : */
18593 :
18594 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self) {
18595 : npy_intp __pyx_r;
18596 :
18597 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":291
18598 : * @property
18599 : * cdef inline npy_intp alignment(self) noexcept nogil:
18600 : * return PyDataType_ALIGNMENT(self) # <<<<<<<<<<<<<<
18601 : *
18602 : * # Use fields/names with care as they may be NULL. You must check
18603 : */
18604 : __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
18605 : goto __pyx_L0;
18606 :
18607 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290
18608 : *
18609 : * @property
18610 : * cdef inline npy_intp alignment(self) noexcept nogil: # <<<<<<<<<<<<<<
18611 : * return PyDataType_ALIGNMENT(self)
18612 : *
18613 : */
18614 :
18615 : /* function exit code */
18616 : __pyx_L0:;
18617 : return __pyx_r;
18618 : }
18619 :
18620 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":296
18621 : * # for this using PyDataType_HASFIELDS.
18622 : * @property
18623 : * cdef inline object fields(self): # <<<<<<<<<<<<<<
18624 : * return <object>PyDataType_FIELDS(self)
18625 : *
18626 : */
18627 :
18628 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self) {
18629 : PyObject *__pyx_r = NULL;
18630 : __Pyx_RefNannyDeclarations
18631 : PyObject *__pyx_t_1;
18632 : __Pyx_RefNannySetupContext("fields", 1);
18633 :
18634 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":297
18635 : * @property
18636 : * cdef inline object fields(self):
18637 : * return <object>PyDataType_FIELDS(self) # <<<<<<<<<<<<<<
18638 : *
18639 : * @property
18640 : */
18641 : __Pyx_XDECREF(__pyx_r);
18642 : __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
18643 : __Pyx_INCREF(((PyObject *)__pyx_t_1));
18644 : __pyx_r = ((PyObject *)__pyx_t_1);
18645 : goto __pyx_L0;
18646 :
18647 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":296
18648 : * # for this using PyDataType_HASFIELDS.
18649 : * @property
18650 : * cdef inline object fields(self): # <<<<<<<<<<<<<<
18651 : * return <object>PyDataType_FIELDS(self)
18652 : *
18653 : */
18654 :
18655 : /* function exit code */
18656 : __pyx_L0:;
18657 : __Pyx_XGIVEREF(__pyx_r);
18658 : __Pyx_RefNannyFinishContext();
18659 : return __pyx_r;
18660 : }
18661 :
18662 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":300
18663 : *
18664 : * @property
18665 : * cdef inline tuple names(self): # <<<<<<<<<<<<<<
18666 : * return <tuple>PyDataType_NAMES(self)
18667 : *
18668 : */
18669 :
18670 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self) {
18671 : PyObject *__pyx_r = NULL;
18672 : __Pyx_RefNannyDeclarations
18673 : PyObject *__pyx_t_1;
18674 : __Pyx_RefNannySetupContext("names", 1);
18675 :
18676 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":301
18677 : * @property
18678 : * cdef inline tuple names(self):
18679 : * return <tuple>PyDataType_NAMES(self) # <<<<<<<<<<<<<<
18680 : *
18681 : * # Use PyDataType_HASSUBARRAY to test whether this field is
18682 : */
18683 : __Pyx_XDECREF(__pyx_r);
18684 : __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
18685 : __Pyx_INCREF(((PyObject*)__pyx_t_1));
18686 : __pyx_r = ((PyObject*)__pyx_t_1);
18687 : goto __pyx_L0;
18688 :
18689 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":300
18690 : *
18691 : * @property
18692 : * cdef inline tuple names(self): # <<<<<<<<<<<<<<
18693 : * return <tuple>PyDataType_NAMES(self)
18694 : *
18695 : */
18696 :
18697 : /* function exit code */
18698 : __pyx_L0:;
18699 : __Pyx_XGIVEREF(__pyx_r);
18700 : __Pyx_RefNannyFinishContext();
18701 : return __pyx_r;
18702 : }
18703 :
18704 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":307
18705 : * # this field via the inline helper method PyDataType_SHAPE.
18706 : * @property
18707 : * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil: # <<<<<<<<<<<<<<
18708 : * return PyDataType_SUBARRAY(self)
18709 : *
18710 : */
18711 :
18712 : static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self) {
18713 : PyArray_ArrayDescr *__pyx_r;
18714 :
18715 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":308
18716 : * @property
18717 : * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
18718 : * return PyDataType_SUBARRAY(self) # <<<<<<<<<<<<<<
18719 : *
18720 : * @property
18721 : */
18722 : __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
18723 : goto __pyx_L0;
18724 :
18725 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":307
18726 : * # this field via the inline helper method PyDataType_SHAPE.
18727 : * @property
18728 : * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil: # <<<<<<<<<<<<<<
18729 : * return PyDataType_SUBARRAY(self)
18730 : *
18731 : */
18732 :
18733 : /* function exit code */
18734 : __pyx_L0:;
18735 : return __pyx_r;
18736 : }
18737 :
18738 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":311
18739 : *
18740 : * @property
18741 : * cdef inline npy_uint64 flags(self) noexcept nogil: # <<<<<<<<<<<<<<
18742 : * """The data types flags."""
18743 : * return PyDataType_FLAGS(self)
18744 : */
18745 :
18746 : static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self) {
18747 : npy_uint64 __pyx_r;
18748 :
18749 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":313
18750 : * cdef inline npy_uint64 flags(self) noexcept nogil:
18751 : * """The data types flags."""
18752 : * return PyDataType_FLAGS(self) # <<<<<<<<<<<<<<
18753 : *
18754 : *
18755 : */
18756 : __pyx_r = PyDataType_FLAGS(__pyx_v_self);
18757 : goto __pyx_L0;
18758 :
18759 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":311
18760 : *
18761 : * @property
18762 : * cdef inline npy_uint64 flags(self) noexcept nogil: # <<<<<<<<<<<<<<
18763 : * """The data types flags."""
18764 : * return PyDataType_FLAGS(self)
18765 : */
18766 :
18767 : /* function exit code */
18768 : __pyx_L0:;
18769 : return __pyx_r;
18770 : }
18771 :
18772 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":323
18773 : *
18774 : * @property
18775 : * cdef inline int numiter(self) noexcept nogil: # <<<<<<<<<<<<<<
18776 : * """The number of arrays that need to be broadcast to the same shape."""
18777 : * return PyArray_MultiIter_NUMITER(self)
18778 : */
18779 :
18780 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self) {
18781 : int __pyx_r;
18782 :
18783 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":325
18784 : * cdef inline int numiter(self) noexcept nogil:
18785 : * """The number of arrays that need to be broadcast to the same shape."""
18786 : * return PyArray_MultiIter_NUMITER(self) # <<<<<<<<<<<<<<
18787 : *
18788 : * @property
18789 : */
18790 : __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
18791 : goto __pyx_L0;
18792 :
18793 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":323
18794 : *
18795 : * @property
18796 : * cdef inline int numiter(self) noexcept nogil: # <<<<<<<<<<<<<<
18797 : * """The number of arrays that need to be broadcast to the same shape."""
18798 : * return PyArray_MultiIter_NUMITER(self)
18799 : */
18800 :
18801 : /* function exit code */
18802 : __pyx_L0:;
18803 : return __pyx_r;
18804 : }
18805 :
18806 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":328
18807 : *
18808 : * @property
18809 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
18810 : * """The total broadcasted size."""
18811 : * return PyArray_MultiIter_SIZE(self)
18812 : */
18813 :
18814 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self) {
18815 : npy_intp __pyx_r;
18816 :
18817 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":330
18818 : * cdef inline npy_intp size(self) noexcept nogil:
18819 : * """The total broadcasted size."""
18820 : * return PyArray_MultiIter_SIZE(self) # <<<<<<<<<<<<<<
18821 : *
18822 : * @property
18823 : */
18824 : __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
18825 : goto __pyx_L0;
18826 :
18827 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":328
18828 : *
18829 : * @property
18830 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
18831 : * """The total broadcasted size."""
18832 : * return PyArray_MultiIter_SIZE(self)
18833 : */
18834 :
18835 : /* function exit code */
18836 : __pyx_L0:;
18837 : return __pyx_r;
18838 : }
18839 :
18840 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":333
18841 : *
18842 : * @property
18843 : * cdef inline npy_intp index(self) noexcept nogil: # <<<<<<<<<<<<<<
18844 : * """The current (1-d) index into the broadcasted result."""
18845 : * return PyArray_MultiIter_INDEX(self)
18846 : */
18847 :
18848 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self) {
18849 : npy_intp __pyx_r;
18850 :
18851 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":335
18852 : * cdef inline npy_intp index(self) noexcept nogil:
18853 : * """The current (1-d) index into the broadcasted result."""
18854 : * return PyArray_MultiIter_INDEX(self) # <<<<<<<<<<<<<<
18855 : *
18856 : * @property
18857 : */
18858 : __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
18859 : goto __pyx_L0;
18860 :
18861 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":333
18862 : *
18863 : * @property
18864 : * cdef inline npy_intp index(self) noexcept nogil: # <<<<<<<<<<<<<<
18865 : * """The current (1-d) index into the broadcasted result."""
18866 : * return PyArray_MultiIter_INDEX(self)
18867 : */
18868 :
18869 : /* function exit code */
18870 : __pyx_L0:;
18871 : return __pyx_r;
18872 : }
18873 :
18874 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":338
18875 : *
18876 : * @property
18877 : * cdef inline int nd(self) noexcept nogil: # <<<<<<<<<<<<<<
18878 : * """The number of dimensions in the broadcasted result."""
18879 : * return PyArray_MultiIter_NDIM(self)
18880 : */
18881 :
18882 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self) {
18883 : int __pyx_r;
18884 :
18885 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":340
18886 : * cdef inline int nd(self) noexcept nogil:
18887 : * """The number of dimensions in the broadcasted result."""
18888 : * return PyArray_MultiIter_NDIM(self) # <<<<<<<<<<<<<<
18889 : *
18890 : * @property
18891 : */
18892 : __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
18893 : goto __pyx_L0;
18894 :
18895 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":338
18896 : *
18897 : * @property
18898 : * cdef inline int nd(self) noexcept nogil: # <<<<<<<<<<<<<<
18899 : * """The number of dimensions in the broadcasted result."""
18900 : * return PyArray_MultiIter_NDIM(self)
18901 : */
18902 :
18903 : /* function exit code */
18904 : __pyx_L0:;
18905 : return __pyx_r;
18906 : }
18907 :
18908 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":343
18909 : *
18910 : * @property
18911 : * cdef inline npy_intp* dimensions(self) noexcept nogil: # <<<<<<<<<<<<<<
18912 : * """The shape of the broadcasted result."""
18913 : * return PyArray_MultiIter_DIMS(self)
18914 : */
18915 :
18916 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self) {
18917 : npy_intp *__pyx_r;
18918 :
18919 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":345
18920 : * cdef inline npy_intp* dimensions(self) noexcept nogil:
18921 : * """The shape of the broadcasted result."""
18922 : * return PyArray_MultiIter_DIMS(self) # <<<<<<<<<<<<<<
18923 : *
18924 : * @property
18925 : */
18926 : __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
18927 : goto __pyx_L0;
18928 :
18929 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":343
18930 : *
18931 : * @property
18932 : * cdef inline npy_intp* dimensions(self) noexcept nogil: # <<<<<<<<<<<<<<
18933 : * """The shape of the broadcasted result."""
18934 : * return PyArray_MultiIter_DIMS(self)
18935 : */
18936 :
18937 : /* function exit code */
18938 : __pyx_L0:;
18939 : return __pyx_r;
18940 : }
18941 :
18942 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":348
18943 : *
18944 : * @property
18945 : * cdef inline void** iters(self) noexcept nogil: # <<<<<<<<<<<<<<
18946 : * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
18947 : * On return, the iterators are adjusted for broadcasting."""
18948 : */
18949 :
18950 : static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self) {
18951 : void **__pyx_r;
18952 :
18953 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":351
18954 : * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
18955 : * On return, the iterators are adjusted for broadcasting."""
18956 : * return PyArray_MultiIter_ITERS(self) # <<<<<<<<<<<<<<
18957 : *
18958 : *
18959 : */
18960 : __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
18961 : goto __pyx_L0;
18962 :
18963 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":348
18964 : *
18965 : * @property
18966 : * cdef inline void** iters(self) noexcept nogil: # <<<<<<<<<<<<<<
18967 : * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
18968 : * On return, the iterators are adjusted for broadcasting."""
18969 : */
18970 :
18971 : /* function exit code */
18972 : __pyx_L0:;
18973 : return __pyx_r;
18974 : }
18975 :
18976 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":366
18977 : *
18978 : * @property
18979 : * cdef inline PyObject* base(self) noexcept nogil: # <<<<<<<<<<<<<<
18980 : * """Returns a borrowed reference to the object owning the data/memory.
18981 : * """
18982 : */
18983 :
18984 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) {
18985 : PyObject *__pyx_r;
18986 :
18987 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":369
18988 : * """Returns a borrowed reference to the object owning the data/memory.
18989 : * """
18990 : * return PyArray_BASE(self) # <<<<<<<<<<<<<<
18991 : *
18992 : * @property
18993 : */
18994 : __pyx_r = PyArray_BASE(__pyx_v_self);
18995 : goto __pyx_L0;
18996 :
18997 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":366
18998 : *
18999 : * @property
19000 : * cdef inline PyObject* base(self) noexcept nogil: # <<<<<<<<<<<<<<
19001 : * """Returns a borrowed reference to the object owning the data/memory.
19002 : * """
19003 : */
19004 :
19005 : /* function exit code */
19006 : __pyx_L0:;
19007 : return __pyx_r;
19008 : }
19009 :
19010 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":372
19011 : *
19012 : * @property
19013 : * cdef inline dtype descr(self): # <<<<<<<<<<<<<<
19014 : * """Returns an owned reference to the dtype of the array.
19015 : * """
19016 : */
19017 :
19018 : static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self) {
19019 : PyArray_Descr *__pyx_r = NULL;
19020 : __Pyx_RefNannyDeclarations
19021 : PyArray_Descr *__pyx_t_1;
19022 : __Pyx_RefNannySetupContext("descr", 1);
19023 :
19024 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":375
19025 : * """Returns an owned reference to the dtype of the array.
19026 : * """
19027 : * return <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
19028 : *
19029 : * @property
19030 : */
19031 : __Pyx_XDECREF((PyObject *)__pyx_r);
19032 : __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
19033 : __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
19034 : __pyx_r = ((PyArray_Descr *)__pyx_t_1);
19035 : goto __pyx_L0;
19036 :
19037 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":372
19038 : *
19039 : * @property
19040 : * cdef inline dtype descr(self): # <<<<<<<<<<<<<<
19041 : * """Returns an owned reference to the dtype of the array.
19042 : * """
19043 : */
19044 :
19045 : /* function exit code */
19046 : __pyx_L0:;
19047 : __Pyx_XGIVEREF((PyObject *)__pyx_r);
19048 : __Pyx_RefNannyFinishContext();
19049 : return __pyx_r;
19050 : }
19051 :
19052 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":378
19053 : *
19054 : * @property
19055 : * cdef inline int ndim(self) noexcept nogil: # <<<<<<<<<<<<<<
19056 : * """Returns the number of dimensions in the array.
19057 : * """
19058 : */
19059 :
19060 : static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) {
19061 : int __pyx_r;
19062 :
19063 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":381
19064 : * """Returns the number of dimensions in the array.
19065 : * """
19066 : * return PyArray_NDIM(self) # <<<<<<<<<<<<<<
19067 : *
19068 : * @property
19069 : */
19070 : __pyx_r = PyArray_NDIM(__pyx_v_self);
19071 : goto __pyx_L0;
19072 :
19073 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":378
19074 : *
19075 : * @property
19076 : * cdef inline int ndim(self) noexcept nogil: # <<<<<<<<<<<<<<
19077 : * """Returns the number of dimensions in the array.
19078 : * """
19079 : */
19080 :
19081 : /* function exit code */
19082 : __pyx_L0:;
19083 : return __pyx_r;
19084 : }
19085 :
19086 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":384
19087 : *
19088 : * @property
19089 : * cdef inline npy_intp *shape(self) noexcept nogil: # <<<<<<<<<<<<<<
19090 : * """Returns a pointer to the dimensions/shape of the array.
19091 : * The number of elements matches the number of dimensions of the array (ndim).
19092 : */
19093 :
19094 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) {
19095 : npy_intp *__pyx_r;
19096 :
19097 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":389
19098 : * Can return NULL for 0-dimensional arrays.
19099 : * """
19100 : * return PyArray_DIMS(self) # <<<<<<<<<<<<<<
19101 : *
19102 : * @property
19103 : */
19104 : __pyx_r = PyArray_DIMS(__pyx_v_self);
19105 : goto __pyx_L0;
19106 :
19107 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":384
19108 : *
19109 : * @property
19110 : * cdef inline npy_intp *shape(self) noexcept nogil: # <<<<<<<<<<<<<<
19111 : * """Returns a pointer to the dimensions/shape of the array.
19112 : * The number of elements matches the number of dimensions of the array (ndim).
19113 : */
19114 :
19115 : /* function exit code */
19116 : __pyx_L0:;
19117 : return __pyx_r;
19118 : }
19119 :
19120 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":392
19121 : *
19122 : * @property
19123 : * cdef inline npy_intp *strides(self) noexcept nogil: # <<<<<<<<<<<<<<
19124 : * """Returns a pointer to the strides of the array.
19125 : * The number of elements matches the number of dimensions of the array (ndim).
19126 : */
19127 :
19128 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) {
19129 : npy_intp *__pyx_r;
19130 :
19131 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":396
19132 : * The number of elements matches the number of dimensions of the array (ndim).
19133 : * """
19134 : * return PyArray_STRIDES(self) # <<<<<<<<<<<<<<
19135 : *
19136 : * @property
19137 : */
19138 : __pyx_r = PyArray_STRIDES(__pyx_v_self);
19139 : goto __pyx_L0;
19140 :
19141 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":392
19142 : *
19143 : * @property
19144 : * cdef inline npy_intp *strides(self) noexcept nogil: # <<<<<<<<<<<<<<
19145 : * """Returns a pointer to the strides of the array.
19146 : * The number of elements matches the number of dimensions of the array (ndim).
19147 : */
19148 :
19149 : /* function exit code */
19150 : __pyx_L0:;
19151 : return __pyx_r;
19152 : }
19153 :
19154 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":399
19155 : *
19156 : * @property
19157 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
19158 : * """Returns the total size (in number of elements) of the array.
19159 : * """
19160 : */
19161 :
19162 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) {
19163 : npy_intp __pyx_r;
19164 :
19165 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":402
19166 : * """Returns the total size (in number of elements) of the array.
19167 : * """
19168 : * return PyArray_SIZE(self) # <<<<<<<<<<<<<<
19169 : *
19170 : * @property
19171 : */
19172 : __pyx_r = PyArray_SIZE(__pyx_v_self);
19173 : goto __pyx_L0;
19174 :
19175 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":399
19176 : *
19177 : * @property
19178 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
19179 : * """Returns the total size (in number of elements) of the array.
19180 : * """
19181 : */
19182 :
19183 : /* function exit code */
19184 : __pyx_L0:;
19185 : return __pyx_r;
19186 : }
19187 :
19188 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":405
19189 : *
19190 : * @property
19191 : * cdef inline char* data(self) noexcept nogil: # <<<<<<<<<<<<<<
19192 : * """The pointer to the data buffer as a char*.
19193 : * This is provided for legacy reasons to avoid direct struct field access.
19194 : */
19195 :
19196 : static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) {
19197 : char *__pyx_r;
19198 :
19199 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":411
19200 : * of `PyArray_DATA()` instead, which returns a 'void*'.
19201 : * """
19202 : * return PyArray_BYTES(self) # <<<<<<<<<<<<<<
19203 : *
19204 : *
19205 : */
19206 : __pyx_r = PyArray_BYTES(__pyx_v_self);
19207 : goto __pyx_L0;
19208 :
19209 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":405
19210 : *
19211 : * @property
19212 : * cdef inline char* data(self) noexcept nogil: # <<<<<<<<<<<<<<
19213 : * """The pointer to the data buffer as a char*.
19214 : * This is provided for legacy reasons to avoid direct struct field access.
19215 : */
19216 :
19217 : /* function exit code */
19218 : __pyx_L0:;
19219 : return __pyx_r;
19220 : }
19221 :
19222 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":806
19223 : * ctypedef long double complex clongdouble_t
19224 : *
19225 : * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
19226 : * return PyArray_MultiIterNew(1, <void*>a)
19227 : *
19228 : */
19229 :
19230 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
19231 : PyObject *__pyx_r = NULL;
19232 : __Pyx_RefNannyDeclarations
19233 : PyObject *__pyx_t_1 = NULL;
19234 : int __pyx_lineno = 0;
19235 : const char *__pyx_filename = NULL;
19236 : int __pyx_clineno = 0;
19237 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 1);
19238 :
19239 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":807
19240 : *
19241 : * cdef inline object PyArray_MultiIterNew1(a):
19242 : * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
19243 : *
19244 : * cdef inline object PyArray_MultiIterNew2(a, b):
19245 : */
19246 : __Pyx_XDECREF(__pyx_r);
19247 : __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 807, __pyx_L1_error)
19248 : __Pyx_GOTREF(__pyx_t_1);
19249 : __pyx_r = __pyx_t_1;
19250 : __pyx_t_1 = 0;
19251 : goto __pyx_L0;
19252 :
19253 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":806
19254 : * ctypedef long double complex clongdouble_t
19255 : *
19256 : * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
19257 : * return PyArray_MultiIterNew(1, <void*>a)
19258 : *
19259 : */
19260 :
19261 : /* function exit code */
19262 : __pyx_L1_error:;
19263 : __Pyx_XDECREF(__pyx_t_1);
19264 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
19265 : __pyx_r = 0;
19266 : __pyx_L0:;
19267 : __Pyx_XGIVEREF(__pyx_r);
19268 : __Pyx_RefNannyFinishContext();
19269 : return __pyx_r;
19270 : }
19271 :
19272 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":809
19273 : * return PyArray_MultiIterNew(1, <void*>a)
19274 : *
19275 : * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
19276 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19277 : *
19278 : */
19279 :
19280 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
19281 : PyObject *__pyx_r = NULL;
19282 : __Pyx_RefNannyDeclarations
19283 : PyObject *__pyx_t_1 = NULL;
19284 : int __pyx_lineno = 0;
19285 : const char *__pyx_filename = NULL;
19286 : int __pyx_clineno = 0;
19287 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 1);
19288 :
19289 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":810
19290 : *
19291 : * cdef inline object PyArray_MultiIterNew2(a, b):
19292 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
19293 : *
19294 : * cdef inline object PyArray_MultiIterNew3(a, b, c):
19295 : */
19296 : __Pyx_XDECREF(__pyx_r);
19297 : __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 810, __pyx_L1_error)
19298 : __Pyx_GOTREF(__pyx_t_1);
19299 : __pyx_r = __pyx_t_1;
19300 : __pyx_t_1 = 0;
19301 : goto __pyx_L0;
19302 :
19303 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":809
19304 : * return PyArray_MultiIterNew(1, <void*>a)
19305 : *
19306 : * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
19307 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19308 : *
19309 : */
19310 :
19311 : /* function exit code */
19312 : __pyx_L1_error:;
19313 : __Pyx_XDECREF(__pyx_t_1);
19314 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
19315 : __pyx_r = 0;
19316 : __pyx_L0:;
19317 : __Pyx_XGIVEREF(__pyx_r);
19318 : __Pyx_RefNannyFinishContext();
19319 : return __pyx_r;
19320 : }
19321 :
19322 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":812
19323 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19324 : *
19325 : * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
19326 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19327 : *
19328 : */
19329 :
19330 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
19331 : PyObject *__pyx_r = NULL;
19332 : __Pyx_RefNannyDeclarations
19333 : PyObject *__pyx_t_1 = NULL;
19334 : int __pyx_lineno = 0;
19335 : const char *__pyx_filename = NULL;
19336 : int __pyx_clineno = 0;
19337 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 1);
19338 :
19339 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":813
19340 : *
19341 : * cdef inline object PyArray_MultiIterNew3(a, b, c):
19342 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
19343 : *
19344 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
19345 : */
19346 : __Pyx_XDECREF(__pyx_r);
19347 : __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 813, __pyx_L1_error)
19348 : __Pyx_GOTREF(__pyx_t_1);
19349 : __pyx_r = __pyx_t_1;
19350 : __pyx_t_1 = 0;
19351 : goto __pyx_L0;
19352 :
19353 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":812
19354 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19355 : *
19356 : * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
19357 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19358 : *
19359 : */
19360 :
19361 : /* function exit code */
19362 : __pyx_L1_error:;
19363 : __Pyx_XDECREF(__pyx_t_1);
19364 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19365 : __pyx_r = 0;
19366 : __pyx_L0:;
19367 : __Pyx_XGIVEREF(__pyx_r);
19368 : __Pyx_RefNannyFinishContext();
19369 : return __pyx_r;
19370 : }
19371 :
19372 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":815
19373 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19374 : *
19375 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
19376 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19377 : *
19378 : */
19379 :
19380 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
19381 : PyObject *__pyx_r = NULL;
19382 : __Pyx_RefNannyDeclarations
19383 : PyObject *__pyx_t_1 = NULL;
19384 : int __pyx_lineno = 0;
19385 : const char *__pyx_filename = NULL;
19386 : int __pyx_clineno = 0;
19387 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 1);
19388 :
19389 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":816
19390 : *
19391 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
19392 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
19393 : *
19394 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
19395 : */
19396 : __Pyx_XDECREF(__pyx_r);
19397 : __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 816, __pyx_L1_error)
19398 : __Pyx_GOTREF(__pyx_t_1);
19399 : __pyx_r = __pyx_t_1;
19400 : __pyx_t_1 = 0;
19401 : goto __pyx_L0;
19402 :
19403 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":815
19404 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19405 : *
19406 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
19407 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19408 : *
19409 : */
19410 :
19411 : /* function exit code */
19412 : __pyx_L1_error:;
19413 : __Pyx_XDECREF(__pyx_t_1);
19414 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
19415 : __pyx_r = 0;
19416 : __pyx_L0:;
19417 : __Pyx_XGIVEREF(__pyx_r);
19418 : __Pyx_RefNannyFinishContext();
19419 : return __pyx_r;
19420 : }
19421 :
19422 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":818
19423 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19424 : *
19425 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
19426 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19427 : *
19428 : */
19429 :
19430 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
19431 : PyObject *__pyx_r = NULL;
19432 : __Pyx_RefNannyDeclarations
19433 : PyObject *__pyx_t_1 = NULL;
19434 : int __pyx_lineno = 0;
19435 : const char *__pyx_filename = NULL;
19436 : int __pyx_clineno = 0;
19437 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 1);
19438 :
19439 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":819
19440 : *
19441 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
19442 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
19443 : *
19444 : * cdef inline tuple PyDataType_SHAPE(dtype d):
19445 : */
19446 : __Pyx_XDECREF(__pyx_r);
19447 : __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 819, __pyx_L1_error)
19448 : __Pyx_GOTREF(__pyx_t_1);
19449 : __pyx_r = __pyx_t_1;
19450 : __pyx_t_1 = 0;
19451 : goto __pyx_L0;
19452 :
19453 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":818
19454 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19455 : *
19456 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
19457 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19458 : *
19459 : */
19460 :
19461 : /* function exit code */
19462 : __pyx_L1_error:;
19463 : __Pyx_XDECREF(__pyx_t_1);
19464 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
19465 : __pyx_r = 0;
19466 : __pyx_L0:;
19467 : __Pyx_XGIVEREF(__pyx_r);
19468 : __Pyx_RefNannyFinishContext();
19469 : return __pyx_r;
19470 : }
19471 :
19472 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":821
19473 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19474 : *
19475 : * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
19476 : * if PyDataType_HASSUBARRAY(d):
19477 : * return <tuple>d.subarray.shape
19478 : */
19479 :
19480 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
19481 : PyObject *__pyx_r = NULL;
19482 : __Pyx_RefNannyDeclarations
19483 : int __pyx_t_1;
19484 : PyObject *__pyx_t_2;
19485 : __Pyx_RefNannySetupContext("PyDataType_SHAPE", 1);
19486 :
19487 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":822
19488 : *
19489 : * cdef inline tuple PyDataType_SHAPE(dtype d):
19490 : * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
19491 : * return <tuple>d.subarray.shape
19492 : * else:
19493 : */
19494 : __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
19495 : if (__pyx_t_1) {
19496 :
19497 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":823
19498 : * cdef inline tuple PyDataType_SHAPE(dtype d):
19499 : * if PyDataType_HASSUBARRAY(d):
19500 : * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
19501 : * else:
19502 : * return ()
19503 : */
19504 : __Pyx_XDECREF(__pyx_r);
19505 : __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray_subarray(__pyx_v_d)->shape;
19506 : __Pyx_INCREF(((PyObject*)__pyx_t_2));
19507 : __pyx_r = ((PyObject*)__pyx_t_2);
19508 : goto __pyx_L0;
19509 :
19510 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":822
19511 : *
19512 : * cdef inline tuple PyDataType_SHAPE(dtype d):
19513 : * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
19514 : * return <tuple>d.subarray.shape
19515 : * else:
19516 : */
19517 : }
19518 :
19519 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":825
19520 : * return <tuple>d.subarray.shape
19521 : * else:
19522 : * return () # <<<<<<<<<<<<<<
19523 : *
19524 : *
19525 : */
19526 : /*else*/ {
19527 : __Pyx_XDECREF(__pyx_r);
19528 : __Pyx_INCREF(__pyx_empty_tuple);
19529 : __pyx_r = __pyx_empty_tuple;
19530 : goto __pyx_L0;
19531 : }
19532 :
19533 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":821
19534 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19535 : *
19536 : * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
19537 : * if PyDataType_HASSUBARRAY(d):
19538 : * return <tuple>d.subarray.shape
19539 : */
19540 :
19541 : /* function exit code */
19542 : __pyx_L0:;
19543 : __Pyx_XGIVEREF(__pyx_r);
19544 : __Pyx_RefNannyFinishContext();
19545 : return __pyx_r;
19546 : }
19547 :
19548 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1009
19549 : * int _import_umath() except -1
19550 : *
19551 : * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
19552 : * Py_INCREF(base) # important to do this before stealing the reference below!
19553 : * PyArray_SetBaseObject(arr, base)
19554 : */
19555 :
19556 : static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
19557 : int __pyx_t_1;
19558 : int __pyx_lineno = 0;
19559 : const char *__pyx_filename = NULL;
19560 : int __pyx_clineno = 0;
19561 :
19562 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1010
19563 : *
19564 : * cdef inline void set_array_base(ndarray arr, object base) except *:
19565 : * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
19566 : * PyArray_SetBaseObject(arr, base)
19567 : *
19568 : */
19569 : Py_INCREF(__pyx_v_base);
19570 :
19571 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1011
19572 : * cdef inline void set_array_base(ndarray arr, object base) except *:
19573 : * Py_INCREF(base) # important to do this before stealing the reference below!
19574 : * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
19575 : *
19576 : * cdef inline object get_array_base(ndarray arr):
19577 : */
19578 : __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 1011, __pyx_L1_error)
19579 :
19580 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1009
19581 : * int _import_umath() except -1
19582 : *
19583 : * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
19584 : * Py_INCREF(base) # important to do this before stealing the reference below!
19585 : * PyArray_SetBaseObject(arr, base)
19586 : */
19587 :
19588 : /* function exit code */
19589 : goto __pyx_L0;
19590 : __pyx_L1_error:;
19591 : __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
19592 : __pyx_L0:;
19593 : }
19594 :
19595 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1013
19596 : * PyArray_SetBaseObject(arr, base)
19597 : *
19598 : * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
19599 : * base = PyArray_BASE(arr)
19600 : * if base is NULL:
19601 : */
19602 :
19603 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
19604 : PyObject *__pyx_v_base;
19605 : PyObject *__pyx_r = NULL;
19606 : __Pyx_RefNannyDeclarations
19607 : int __pyx_t_1;
19608 : __Pyx_RefNannySetupContext("get_array_base", 1);
19609 :
19610 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1014
19611 : *
19612 : * cdef inline object get_array_base(ndarray arr):
19613 : * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
19614 : * if base is NULL:
19615 : * return None
19616 : */
19617 : __pyx_v_base = PyArray_BASE(__pyx_v_arr);
19618 :
19619 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1015
19620 : * cdef inline object get_array_base(ndarray arr):
19621 : * base = PyArray_BASE(arr)
19622 : * if base is NULL: # <<<<<<<<<<<<<<
19623 : * return None
19624 : * return <object>base
19625 : */
19626 : __pyx_t_1 = (__pyx_v_base == NULL);
19627 : if (__pyx_t_1) {
19628 :
19629 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1016
19630 : * base = PyArray_BASE(arr)
19631 : * if base is NULL:
19632 : * return None # <<<<<<<<<<<<<<
19633 : * return <object>base
19634 : *
19635 : */
19636 : __Pyx_XDECREF(__pyx_r);
19637 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19638 : goto __pyx_L0;
19639 :
19640 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1015
19641 : * cdef inline object get_array_base(ndarray arr):
19642 : * base = PyArray_BASE(arr)
19643 : * if base is NULL: # <<<<<<<<<<<<<<
19644 : * return None
19645 : * return <object>base
19646 : */
19647 : }
19648 :
19649 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1017
19650 : * if base is NULL:
19651 : * return None
19652 : * return <object>base # <<<<<<<<<<<<<<
19653 : *
19654 : * # Versions of the import_* functions which are more suitable for
19655 : */
19656 : __Pyx_XDECREF(__pyx_r);
19657 : __Pyx_INCREF(((PyObject *)__pyx_v_base));
19658 : __pyx_r = ((PyObject *)__pyx_v_base);
19659 : goto __pyx_L0;
19660 :
19661 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1013
19662 : * PyArray_SetBaseObject(arr, base)
19663 : *
19664 : * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
19665 : * base = PyArray_BASE(arr)
19666 : * if base is NULL:
19667 : */
19668 :
19669 : /* function exit code */
19670 : __pyx_L0:;
19671 : __Pyx_XGIVEREF(__pyx_r);
19672 : __Pyx_RefNannyFinishContext();
19673 : return __pyx_r;
19674 : }
19675 :
19676 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1021
19677 : * # Versions of the import_* functions which are more suitable for
19678 : * # Cython code.
19679 : * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
19680 : * try:
19681 : * __pyx_import_array()
19682 : */
19683 :
19684 3 : static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
19685 3 : int __pyx_r;
19686 : __Pyx_RefNannyDeclarations
19687 3 : PyObject *__pyx_t_1 = NULL;
19688 3 : PyObject *__pyx_t_2 = NULL;
19689 3 : PyObject *__pyx_t_3 = NULL;
19690 3 : int __pyx_t_4;
19691 3 : PyObject *__pyx_t_5 = NULL;
19692 3 : PyObject *__pyx_t_6 = NULL;
19693 3 : PyObject *__pyx_t_7 = NULL;
19694 3 : PyObject *__pyx_t_8 = NULL;
19695 3 : int __pyx_lineno = 0;
19696 3 : const char *__pyx_filename = NULL;
19697 3 : int __pyx_clineno = 0;
19698 3 : __Pyx_RefNannySetupContext("import_array", 1);
19699 :
19700 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
19701 : * # Cython code.
19702 : * cdef inline int import_array() except -1:
19703 : * try: # <<<<<<<<<<<<<<
19704 : * __pyx_import_array()
19705 : * except Exception:
19706 : */
19707 : {
19708 3 : __Pyx_PyThreadState_declare
19709 3 : __Pyx_PyThreadState_assign
19710 3 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
19711 3 : __Pyx_XGOTREF(__pyx_t_1);
19712 3 : __Pyx_XGOTREF(__pyx_t_2);
19713 3 : __Pyx_XGOTREF(__pyx_t_3);
19714 : /*try:*/ {
19715 :
19716 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1023
19717 : * cdef inline int import_array() except -1:
19718 : * try:
19719 : * __pyx_import_array() # <<<<<<<<<<<<<<
19720 : * except Exception:
19721 : * raise ImportError("numpy._core.multiarray failed to import")
19722 : */
19723 3 : __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1023, __pyx_L3_error)
19724 :
19725 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
19726 : * # Cython code.
19727 : * cdef inline int import_array() except -1:
19728 : * try: # <<<<<<<<<<<<<<
19729 : * __pyx_import_array()
19730 : * except Exception:
19731 : */
19732 : }
19733 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
19734 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19735 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
19736 3 : goto __pyx_L8_try_end;
19737 0 : __pyx_L3_error:;
19738 :
19739 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1024
19740 : * try:
19741 : * __pyx_import_array()
19742 : * except Exception: # <<<<<<<<<<<<<<
19743 : * raise ImportError("numpy._core.multiarray failed to import")
19744 : *
19745 : */
19746 0 : __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
19747 0 : if (__pyx_t_4) {
19748 0 : __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
19749 0 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1024, __pyx_L5_except_error)
19750 0 : __Pyx_XGOTREF(__pyx_t_5);
19751 0 : __Pyx_XGOTREF(__pyx_t_6);
19752 0 : __Pyx_XGOTREF(__pyx_t_7);
19753 :
19754 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1025
19755 : * __pyx_import_array()
19756 : * except Exception:
19757 : * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
19758 : *
19759 : * cdef inline int import_umath() except -1:
19760 : */
19761 0 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1025, __pyx_L5_except_error)
19762 0 : __Pyx_GOTREF(__pyx_t_8);
19763 0 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
19764 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19765 0 : __PYX_ERR(2, 1025, __pyx_L5_except_error)
19766 : }
19767 0 : goto __pyx_L5_except_error;
19768 :
19769 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
19770 : * # Cython code.
19771 : * cdef inline int import_array() except -1:
19772 : * try: # <<<<<<<<<<<<<<
19773 : * __pyx_import_array()
19774 : * except Exception:
19775 : */
19776 0 : __pyx_L5_except_error:;
19777 0 : __Pyx_XGIVEREF(__pyx_t_1);
19778 0 : __Pyx_XGIVEREF(__pyx_t_2);
19779 0 : __Pyx_XGIVEREF(__pyx_t_3);
19780 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
19781 0 : goto __pyx_L1_error;
19782 3 : __pyx_L8_try_end:;
19783 : }
19784 :
19785 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1021
19786 : * # Versions of the import_* functions which are more suitable for
19787 : * # Cython code.
19788 : * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
19789 : * try:
19790 : * __pyx_import_array()
19791 : */
19792 :
19793 : /* function exit code */
19794 3 : __pyx_r = 0;
19795 3 : goto __pyx_L0;
19796 0 : __pyx_L1_error:;
19797 0 : __Pyx_XDECREF(__pyx_t_5);
19798 0 : __Pyx_XDECREF(__pyx_t_6);
19799 0 : __Pyx_XDECREF(__pyx_t_7);
19800 0 : __Pyx_XDECREF(__pyx_t_8);
19801 0 : __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
19802 0 : __pyx_r = -1;
19803 3 : __pyx_L0:;
19804 3 : __Pyx_RefNannyFinishContext();
19805 3 : return __pyx_r;
19806 : }
19807 :
19808 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1027
19809 : * raise ImportError("numpy._core.multiarray failed to import")
19810 : *
19811 : * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
19812 : * try:
19813 : * _import_umath()
19814 : */
19815 :
19816 : static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
19817 : int __pyx_r;
19818 : __Pyx_RefNannyDeclarations
19819 : PyObject *__pyx_t_1 = NULL;
19820 : PyObject *__pyx_t_2 = NULL;
19821 : PyObject *__pyx_t_3 = NULL;
19822 : int __pyx_t_4;
19823 : PyObject *__pyx_t_5 = NULL;
19824 : PyObject *__pyx_t_6 = NULL;
19825 : PyObject *__pyx_t_7 = NULL;
19826 : PyObject *__pyx_t_8 = NULL;
19827 : int __pyx_lineno = 0;
19828 : const char *__pyx_filename = NULL;
19829 : int __pyx_clineno = 0;
19830 : __Pyx_RefNannySetupContext("import_umath", 1);
19831 :
19832 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
19833 : *
19834 : * cdef inline int import_umath() except -1:
19835 : * try: # <<<<<<<<<<<<<<
19836 : * _import_umath()
19837 : * except Exception:
19838 : */
19839 : {
19840 : __Pyx_PyThreadState_declare
19841 : __Pyx_PyThreadState_assign
19842 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
19843 : __Pyx_XGOTREF(__pyx_t_1);
19844 : __Pyx_XGOTREF(__pyx_t_2);
19845 : __Pyx_XGOTREF(__pyx_t_3);
19846 : /*try:*/ {
19847 :
19848 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1029
19849 : * cdef inline int import_umath() except -1:
19850 : * try:
19851 : * _import_umath() # <<<<<<<<<<<<<<
19852 : * except Exception:
19853 : * raise ImportError("numpy._core.umath failed to import")
19854 : */
19855 : __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1029, __pyx_L3_error)
19856 :
19857 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
19858 : *
19859 : * cdef inline int import_umath() except -1:
19860 : * try: # <<<<<<<<<<<<<<
19861 : * _import_umath()
19862 : * except Exception:
19863 : */
19864 : }
19865 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
19866 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19867 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
19868 : goto __pyx_L8_try_end;
19869 : __pyx_L3_error:;
19870 :
19871 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1030
19872 : * try:
19873 : * _import_umath()
19874 : * except Exception: # <<<<<<<<<<<<<<
19875 : * raise ImportError("numpy._core.umath failed to import")
19876 : *
19877 : */
19878 : __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
19879 : if (__pyx_t_4) {
19880 : __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
19881 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1030, __pyx_L5_except_error)
19882 : __Pyx_XGOTREF(__pyx_t_5);
19883 : __Pyx_XGOTREF(__pyx_t_6);
19884 : __Pyx_XGOTREF(__pyx_t_7);
19885 :
19886 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1031
19887 : * _import_umath()
19888 : * except Exception:
19889 : * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
19890 : *
19891 : * cdef inline int import_ufunc() except -1:
19892 : */
19893 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1031, __pyx_L5_except_error)
19894 : __Pyx_GOTREF(__pyx_t_8);
19895 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
19896 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19897 : __PYX_ERR(2, 1031, __pyx_L5_except_error)
19898 : }
19899 : goto __pyx_L5_except_error;
19900 :
19901 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
19902 : *
19903 : * cdef inline int import_umath() except -1:
19904 : * try: # <<<<<<<<<<<<<<
19905 : * _import_umath()
19906 : * except Exception:
19907 : */
19908 : __pyx_L5_except_error:;
19909 : __Pyx_XGIVEREF(__pyx_t_1);
19910 : __Pyx_XGIVEREF(__pyx_t_2);
19911 : __Pyx_XGIVEREF(__pyx_t_3);
19912 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
19913 : goto __pyx_L1_error;
19914 : __pyx_L8_try_end:;
19915 : }
19916 :
19917 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1027
19918 : * raise ImportError("numpy._core.multiarray failed to import")
19919 : *
19920 : * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
19921 : * try:
19922 : * _import_umath()
19923 : */
19924 :
19925 : /* function exit code */
19926 : __pyx_r = 0;
19927 : goto __pyx_L0;
19928 : __pyx_L1_error:;
19929 : __Pyx_XDECREF(__pyx_t_5);
19930 : __Pyx_XDECREF(__pyx_t_6);
19931 : __Pyx_XDECREF(__pyx_t_7);
19932 : __Pyx_XDECREF(__pyx_t_8);
19933 : __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
19934 : __pyx_r = -1;
19935 : __pyx_L0:;
19936 : __Pyx_RefNannyFinishContext();
19937 : return __pyx_r;
19938 : }
19939 :
19940 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1033
19941 : * raise ImportError("numpy._core.umath failed to import")
19942 : *
19943 : * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
19944 : * try:
19945 : * _import_umath()
19946 : */
19947 :
19948 : static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
19949 : int __pyx_r;
19950 : __Pyx_RefNannyDeclarations
19951 : PyObject *__pyx_t_1 = NULL;
19952 : PyObject *__pyx_t_2 = NULL;
19953 : PyObject *__pyx_t_3 = NULL;
19954 : int __pyx_t_4;
19955 : PyObject *__pyx_t_5 = NULL;
19956 : PyObject *__pyx_t_6 = NULL;
19957 : PyObject *__pyx_t_7 = NULL;
19958 : PyObject *__pyx_t_8 = NULL;
19959 : int __pyx_lineno = 0;
19960 : const char *__pyx_filename = NULL;
19961 : int __pyx_clineno = 0;
19962 : __Pyx_RefNannySetupContext("import_ufunc", 1);
19963 :
19964 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
19965 : *
19966 : * cdef inline int import_ufunc() except -1:
19967 : * try: # <<<<<<<<<<<<<<
19968 : * _import_umath()
19969 : * except Exception:
19970 : */
19971 : {
19972 : __Pyx_PyThreadState_declare
19973 : __Pyx_PyThreadState_assign
19974 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
19975 : __Pyx_XGOTREF(__pyx_t_1);
19976 : __Pyx_XGOTREF(__pyx_t_2);
19977 : __Pyx_XGOTREF(__pyx_t_3);
19978 : /*try:*/ {
19979 :
19980 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1035
19981 : * cdef inline int import_ufunc() except -1:
19982 : * try:
19983 : * _import_umath() # <<<<<<<<<<<<<<
19984 : * except Exception:
19985 : * raise ImportError("numpy._core.umath failed to import")
19986 : */
19987 : __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1035, __pyx_L3_error)
19988 :
19989 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
19990 : *
19991 : * cdef inline int import_ufunc() except -1:
19992 : * try: # <<<<<<<<<<<<<<
19993 : * _import_umath()
19994 : * except Exception:
19995 : */
19996 : }
19997 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
19998 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19999 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20000 : goto __pyx_L8_try_end;
20001 : __pyx_L3_error:;
20002 :
20003 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1036
20004 : * try:
20005 : * _import_umath()
20006 : * except Exception: # <<<<<<<<<<<<<<
20007 : * raise ImportError("numpy._core.umath failed to import")
20008 : *
20009 : */
20010 : __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
20011 : if (__pyx_t_4) {
20012 : __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
20013 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1036, __pyx_L5_except_error)
20014 : __Pyx_XGOTREF(__pyx_t_5);
20015 : __Pyx_XGOTREF(__pyx_t_6);
20016 : __Pyx_XGOTREF(__pyx_t_7);
20017 :
20018 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1037
20019 : * _import_umath()
20020 : * except Exception:
20021 : * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
20022 : *
20023 : *
20024 : */
20025 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1037, __pyx_L5_except_error)
20026 : __Pyx_GOTREF(__pyx_t_8);
20027 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20028 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20029 : __PYX_ERR(2, 1037, __pyx_L5_except_error)
20030 : }
20031 : goto __pyx_L5_except_error;
20032 :
20033 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
20034 : *
20035 : * cdef inline int import_ufunc() except -1:
20036 : * try: # <<<<<<<<<<<<<<
20037 : * _import_umath()
20038 : * except Exception:
20039 : */
20040 : __pyx_L5_except_error:;
20041 : __Pyx_XGIVEREF(__pyx_t_1);
20042 : __Pyx_XGIVEREF(__pyx_t_2);
20043 : __Pyx_XGIVEREF(__pyx_t_3);
20044 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20045 : goto __pyx_L1_error;
20046 : __pyx_L8_try_end:;
20047 : }
20048 :
20049 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1033
20050 : * raise ImportError("numpy._core.umath failed to import")
20051 : *
20052 : * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
20053 : * try:
20054 : * _import_umath()
20055 : */
20056 :
20057 : /* function exit code */
20058 : __pyx_r = 0;
20059 : goto __pyx_L0;
20060 : __pyx_L1_error:;
20061 : __Pyx_XDECREF(__pyx_t_5);
20062 : __Pyx_XDECREF(__pyx_t_6);
20063 : __Pyx_XDECREF(__pyx_t_7);
20064 : __Pyx_XDECREF(__pyx_t_8);
20065 : __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
20066 : __pyx_r = -1;
20067 : __pyx_L0:;
20068 : __Pyx_RefNannyFinishContext();
20069 : return __pyx_r;
20070 : }
20071 :
20072 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040
20073 : *
20074 : *
20075 : * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
20076 : * """
20077 : * Cython equivalent of `isinstance(obj, np.timedelta64)`
20078 : */
20079 :
20080 : static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
20081 : int __pyx_r;
20082 :
20083 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1052
20084 : * bool
20085 : * """
20086 : * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
20087 : *
20088 : *
20089 : */
20090 : __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
20091 : goto __pyx_L0;
20092 :
20093 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040
20094 : *
20095 : *
20096 : * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
20097 : * """
20098 : * Cython equivalent of `isinstance(obj, np.timedelta64)`
20099 : */
20100 :
20101 : /* function exit code */
20102 : __pyx_L0:;
20103 : return __pyx_r;
20104 : }
20105 :
20106 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1055
20107 : *
20108 : *
20109 : * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
20110 : * """
20111 : * Cython equivalent of `isinstance(obj, np.datetime64)`
20112 : */
20113 :
20114 : static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
20115 : int __pyx_r;
20116 :
20117 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1067
20118 : * bool
20119 : * """
20120 : * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
20121 : *
20122 : *
20123 : */
20124 : __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
20125 : goto __pyx_L0;
20126 :
20127 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1055
20128 : *
20129 : *
20130 : * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
20131 : * """
20132 : * Cython equivalent of `isinstance(obj, np.datetime64)`
20133 : */
20134 :
20135 : /* function exit code */
20136 : __pyx_L0:;
20137 : return __pyx_r;
20138 : }
20139 :
20140 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1070
20141 : *
20142 : *
20143 : * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20144 : * """
20145 : * returns the int64 value underlying scalar numpy datetime64 object
20146 : */
20147 :
20148 : static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
20149 : npy_datetime __pyx_r;
20150 :
20151 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1077
20152 : * also needed. That can be found using `get_datetime64_unit`.
20153 : * """
20154 : * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
20155 : *
20156 : *
20157 : */
20158 : __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
20159 : goto __pyx_L0;
20160 :
20161 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1070
20162 : *
20163 : *
20164 : * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20165 : * """
20166 : * returns the int64 value underlying scalar numpy datetime64 object
20167 : */
20168 :
20169 : /* function exit code */
20170 : __pyx_L0:;
20171 : return __pyx_r;
20172 : }
20173 :
20174 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1080
20175 : *
20176 : *
20177 : * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20178 : * """
20179 : * returns the int64 value underlying scalar numpy timedelta64 object
20180 : */
20181 :
20182 : static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
20183 : npy_timedelta __pyx_r;
20184 :
20185 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1084
20186 : * returns the int64 value underlying scalar numpy timedelta64 object
20187 : * """
20188 : * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
20189 : *
20190 : *
20191 : */
20192 : __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
20193 : goto __pyx_L0;
20194 :
20195 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1080
20196 : *
20197 : *
20198 : * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20199 : * """
20200 : * returns the int64 value underlying scalar numpy timedelta64 object
20201 : */
20202 :
20203 : /* function exit code */
20204 : __pyx_L0:;
20205 : return __pyx_r;
20206 : }
20207 :
20208 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1087
20209 : *
20210 : *
20211 : * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20212 : * """
20213 : * returns the unit part of the dtype for a numpy datetime64 object.
20214 : */
20215 :
20216 : static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
20217 : NPY_DATETIMEUNIT __pyx_r;
20218 :
20219 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1091
20220 : * returns the unit part of the dtype for a numpy datetime64 object.
20221 : * """
20222 : * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
20223 : *
20224 : *
20225 : */
20226 : __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
20227 : goto __pyx_L0;
20228 :
20229 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1087
20230 : *
20231 : *
20232 : * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20233 : * """
20234 : * returns the unit part of the dtype for a numpy datetime64 object.
20235 : */
20236 :
20237 : /* function exit code */
20238 : __pyx_L0:;
20239 : return __pyx_r;
20240 : }
20241 :
20242 : /* "scipy/sparse/csgraph/_reordering.pyx":16
20243 : * include 'parameters.pxi'
20244 : *
20245 : * def reverse_cuthill_mckee(graph, symmetric_mode=False): # <<<<<<<<<<<<<<
20246 : * """
20247 : * reverse_cuthill_mckee(graph, symmetric_mode=False)
20248 : */
20249 :
20250 : /* Python wrapper */
20251 : static PyObject *__pyx_pw_5scipy_6sparse_7csgraph_11_reordering_1reverse_cuthill_mckee(PyObject *__pyx_self,
20252 : #if CYTHON_METH_FASTCALL
20253 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
20254 : #else
20255 : PyObject *__pyx_args, PyObject *__pyx_kwds
20256 : #endif
20257 : ); /*proto*/
20258 : PyDoc_STRVAR(__pyx_doc_5scipy_6sparse_7csgraph_11_reordering_reverse_cuthill_mckee, "\n reverse_cuthill_mckee(graph, symmetric_mode=False)\n \n Returns the permutation array that orders a sparse CSR or CSC matrix\n in Reverse-Cuthill McKee ordering. \n \n It is assumed by default, ``symmetric_mode=False``, that the input matrix \n is not symmetric and works on the matrix ``A+A.T``. If you are \n guaranteed that the matrix is symmetric in structure (values of matrix \n elements do not matter) then set ``symmetric_mode=True``.\n \n Parameters\n ----------\n graph : sparse array or matrix\n Input sparse in CSC or CSR sparse array or matrix format.\n symmetric_mode : bool, optional\n Is input matrix guaranteed to be symmetric.\n\n Returns\n -------\n perm : ndarray\n Array of permuted row and column indices.\n \n Notes\n -----\n .. versionadded:: 0.15.0\n\n References\n ----------\n E. Cuthill and J. McKee, \"Reducing the Bandwidth of Sparse Symmetric Matrices\",\n ACM '69 Proceedings of the 1969 24th national conference, (1969).\n\n Examples\n --------\n >>> from scipy.sparse import csr_array\n >>> from scipy.sparse.csgraph import reverse_cuthill_mckee\n\n >>> graph = [\n ... [0, 1, 2, 0],\n ... [0, 0, 0, 1],\n ... [2, 0, 0, 3],\n ... [0, 0, 0, 0]\n ... ]\n >>> graph = csr_array(graph)\n >>> print(graph)\n <Compressed Sparse Row sparse array of dtype 'int64'\n with 5 stored elements and shape (4, 4)>\n Coords\tValues\n (0, 1)\t1\n (0, 2)\t2\n (1, 3)\t1\n (2, 0)\t2\n (2, 3)\t3\n\n >>> reverse_cuthill_mckee(graph)\n array([3, 2, 1, 0], dtype=int32)\n \n ");
20259 : static PyMethodDef __pyx_mdef_5scipy_6sparse_7csgraph_11_reordering_1reverse_cuthill_mckee = {"reverse_cuthill_mckee", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6sparse_7csgraph_11_reordering_1reverse_cuthill_mckee, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_6sparse_7csgraph_11_reordering_reverse_cuthill_mckee};
20260 3 : static PyObject *__pyx_pw_5scipy_6sparse_7csgraph_11_reordering_1reverse_cuthill_mckee(PyObject *__pyx_self,
20261 : #if CYTHON_METH_FASTCALL
20262 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
20263 : #else
20264 : PyObject *__pyx_args, PyObject *__pyx_kwds
20265 : #endif
20266 : ) {
20267 3 : PyObject *__pyx_v_graph = 0;
20268 3 : PyObject *__pyx_v_symmetric_mode = 0;
20269 : #if !CYTHON_METH_FASTCALL
20270 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
20271 : #endif
20272 3 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
20273 3 : PyObject* values[2] = {0,0};
20274 3 : int __pyx_lineno = 0;
20275 3 : const char *__pyx_filename = NULL;
20276 3 : int __pyx_clineno = 0;
20277 3 : PyObject *__pyx_r = 0;
20278 : __Pyx_RefNannyDeclarations
20279 3 : __Pyx_RefNannySetupContext("reverse_cuthill_mckee (wrapper)", 0);
20280 : #if !CYTHON_METH_FASTCALL
20281 : #if CYTHON_ASSUME_SAFE_MACROS
20282 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
20283 : #else
20284 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
20285 : #endif
20286 : #endif
20287 3 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
20288 : {
20289 3 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_graph,&__pyx_n_s_symmetric_mode,0};
20290 3 : values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False)));
20291 3 : if (__pyx_kwds) {
20292 0 : Py_ssize_t kw_args;
20293 0 : switch (__pyx_nargs) {
20294 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
20295 0 : CYTHON_FALLTHROUGH;
20296 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
20297 0 : CYTHON_FALLTHROUGH;
20298 0 : case 0: break;
20299 0 : default: goto __pyx_L5_argtuple_error;
20300 : }
20301 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
20302 0 : switch (__pyx_nargs) {
20303 : case 0:
20304 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_graph)) != 0)) {
20305 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
20306 0 : kw_args--;
20307 : }
20308 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error)
20309 0 : else goto __pyx_L5_argtuple_error;
20310 0 : CYTHON_FALLTHROUGH;
20311 : case 1:
20312 0 : if (kw_args > 0) {
20313 0 : PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_symmetric_mode);
20314 0 : if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
20315 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error)
20316 : }
20317 : }
20318 0 : if (unlikely(kw_args > 0)) {
20319 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
20320 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "reverse_cuthill_mckee") < 0)) __PYX_ERR(0, 16, __pyx_L3_error)
20321 : }
20322 : } else {
20323 3 : switch (__pyx_nargs) {
20324 1 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
20325 3 : CYTHON_FALLTHROUGH;
20326 3 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
20327 3 : break;
20328 0 : default: goto __pyx_L5_argtuple_error;
20329 : }
20330 : }
20331 3 : __pyx_v_graph = values[0];
20332 3 : __pyx_v_symmetric_mode = values[1];
20333 : }
20334 3 : goto __pyx_L6_skip;
20335 0 : __pyx_L5_argtuple_error:;
20336 0 : __Pyx_RaiseArgtupleInvalid("reverse_cuthill_mckee", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 16, __pyx_L3_error)
20337 3 : __pyx_L6_skip:;
20338 3 : goto __pyx_L4_argument_unpacking_done;
20339 0 : __pyx_L3_error:;
20340 : {
20341 0 : Py_ssize_t __pyx_temp;
20342 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
20343 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
20344 : }
20345 : }
20346 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._reordering.reverse_cuthill_mckee", __pyx_clineno, __pyx_lineno, __pyx_filename);
20347 0 : __Pyx_RefNannyFinishContext();
20348 0 : return NULL;
20349 3 : __pyx_L4_argument_unpacking_done:;
20350 3 : __pyx_r = __pyx_pf_5scipy_6sparse_7csgraph_11_reordering_reverse_cuthill_mckee(__pyx_self, __pyx_v_graph, __pyx_v_symmetric_mode);
20351 :
20352 : /* function exit code */
20353 : {
20354 3 : Py_ssize_t __pyx_temp;
20355 3 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
20356 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
20357 : }
20358 : }
20359 : __Pyx_RefNannyFinishContext();
20360 : return __pyx_r;
20361 : }
20362 :
20363 3 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_11_reordering_reverse_cuthill_mckee(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_graph, PyObject *__pyx_v_symmetric_mode) {
20364 3 : PyObject *__pyx_v_nrows = NULL;
20365 3 : PyObject *__pyx_r = NULL;
20366 : __Pyx_RefNannyDeclarations
20367 3 : PyObject *__pyx_t_1 = NULL;
20368 3 : PyObject *__pyx_t_2 = NULL;
20369 3 : PyObject *__pyx_t_3 = NULL;
20370 3 : unsigned int __pyx_t_4;
20371 3 : int __pyx_t_5;
20372 3 : int __pyx_t_6;
20373 3 : PyObject *__pyx_t_7 = NULL;
20374 3 : PyObject *__pyx_t_8 = NULL;
20375 3 : int __pyx_lineno = 0;
20376 3 : const char *__pyx_filename = NULL;
20377 3 : int __pyx_clineno = 0;
20378 3 : __Pyx_RefNannySetupContext("reverse_cuthill_mckee", 0);
20379 3 : __Pyx_INCREF(__pyx_v_graph);
20380 :
20381 : /* "scipy/sparse/csgraph/_reordering.pyx":75
20382 : *
20383 : * """
20384 : * graph = convert_pydata_sparse_to_scipy(graph) # <<<<<<<<<<<<<<
20385 : * if not issparse(graph):
20386 : * raise TypeError("Input graph must be sparse")
20387 : */
20388 3 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_convert_pydata_sparse_to_scipy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error)
20389 3 : __Pyx_GOTREF(__pyx_t_2);
20390 3 : __pyx_t_3 = NULL;
20391 3 : __pyx_t_4 = 0;
20392 : #if CYTHON_UNPACK_METHODS
20393 3 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
20394 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
20395 0 : if (likely(__pyx_t_3)) {
20396 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20397 0 : __Pyx_INCREF(__pyx_t_3);
20398 0 : __Pyx_INCREF(function);
20399 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
20400 : __pyx_t_4 = 1;
20401 : }
20402 : }
20403 : #endif
20404 : {
20405 3 : PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_graph};
20406 3 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
20407 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20408 3 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error)
20409 3 : __Pyx_GOTREF(__pyx_t_1);
20410 3 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20411 : }
20412 3 : __Pyx_DECREF_SET(__pyx_v_graph, __pyx_t_1);
20413 3 : __pyx_t_1 = 0;
20414 :
20415 : /* "scipy/sparse/csgraph/_reordering.pyx":76
20416 : * """
20417 : * graph = convert_pydata_sparse_to_scipy(graph)
20418 : * if not issparse(graph): # <<<<<<<<<<<<<<
20419 : * raise TypeError("Input graph must be sparse")
20420 : * if graph.format not in ("csc", "csr"):
20421 : */
20422 3 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_issparse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)
20423 3 : __Pyx_GOTREF(__pyx_t_2);
20424 3 : __pyx_t_3 = NULL;
20425 3 : __pyx_t_4 = 0;
20426 : #if CYTHON_UNPACK_METHODS
20427 3 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
20428 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
20429 0 : if (likely(__pyx_t_3)) {
20430 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20431 0 : __Pyx_INCREF(__pyx_t_3);
20432 0 : __Pyx_INCREF(function);
20433 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
20434 : __pyx_t_4 = 1;
20435 : }
20436 : }
20437 : #endif
20438 : {
20439 3 : PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_graph};
20440 3 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
20441 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20442 3 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
20443 3 : __Pyx_GOTREF(__pyx_t_1);
20444 3 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20445 : }
20446 3 : __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 76, __pyx_L1_error)
20447 3 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20448 3 : __pyx_t_6 = (!__pyx_t_5);
20449 3 : if (unlikely(__pyx_t_6)) {
20450 :
20451 : /* "scipy/sparse/csgraph/_reordering.pyx":77
20452 : * graph = convert_pydata_sparse_to_scipy(graph)
20453 : * if not issparse(graph):
20454 : * raise TypeError("Input graph must be sparse") # <<<<<<<<<<<<<<
20455 : * if graph.format not in ("csc", "csr"):
20456 : * raise TypeError('Input must be in CSC or CSR sparse format.')
20457 : */
20458 0 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
20459 0 : __Pyx_GOTREF(__pyx_t_1);
20460 0 : __Pyx_Raise(__pyx_t_1, 0, 0, 0);
20461 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20462 0 : __PYX_ERR(0, 77, __pyx_L1_error)
20463 :
20464 : /* "scipy/sparse/csgraph/_reordering.pyx":76
20465 : * """
20466 : * graph = convert_pydata_sparse_to_scipy(graph)
20467 : * if not issparse(graph): # <<<<<<<<<<<<<<
20468 : * raise TypeError("Input graph must be sparse")
20469 : * if graph.format not in ("csc", "csr"):
20470 : */
20471 : }
20472 :
20473 : /* "scipy/sparse/csgraph/_reordering.pyx":78
20474 : * if not issparse(graph):
20475 : * raise TypeError("Input graph must be sparse")
20476 : * if graph.format not in ("csc", "csr"): # <<<<<<<<<<<<<<
20477 : * raise TypeError('Input must be in CSC or CSR sparse format.')
20478 : * nrows = graph.shape[0]
20479 : */
20480 3 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
20481 3 : __Pyx_GOTREF(__pyx_t_1);
20482 3 : __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_csc, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 78, __pyx_L1_error)
20483 3 : if (__pyx_t_5) {
20484 3 : } else {
20485 0 : __pyx_t_6 = __pyx_t_5;
20486 0 : goto __pyx_L5_bool_binop_done;
20487 : }
20488 3 : __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_csr, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 78, __pyx_L1_error)
20489 : __pyx_t_6 = __pyx_t_5;
20490 3 : __pyx_L5_bool_binop_done:;
20491 3 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20492 3 : __pyx_t_5 = __pyx_t_6;
20493 3 : if (unlikely(__pyx_t_5)) {
20494 :
20495 : /* "scipy/sparse/csgraph/_reordering.pyx":79
20496 : * raise TypeError("Input graph must be sparse")
20497 : * if graph.format not in ("csc", "csr"):
20498 : * raise TypeError('Input must be in CSC or CSR sparse format.') # <<<<<<<<<<<<<<
20499 : * nrows = graph.shape[0]
20500 : * if not symmetric_mode:
20501 : */
20502 0 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
20503 0 : __Pyx_GOTREF(__pyx_t_1);
20504 0 : __Pyx_Raise(__pyx_t_1, 0, 0, 0);
20505 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20506 0 : __PYX_ERR(0, 79, __pyx_L1_error)
20507 :
20508 : /* "scipy/sparse/csgraph/_reordering.pyx":78
20509 : * if not issparse(graph):
20510 : * raise TypeError("Input graph must be sparse")
20511 : * if graph.format not in ("csc", "csr"): # <<<<<<<<<<<<<<
20512 : * raise TypeError('Input must be in CSC or CSR sparse format.')
20513 : * nrows = graph.shape[0]
20514 : */
20515 : }
20516 :
20517 : /* "scipy/sparse/csgraph/_reordering.pyx":80
20518 : * if graph.format not in ("csc", "csr"):
20519 : * raise TypeError('Input must be in CSC or CSR sparse format.')
20520 : * nrows = graph.shape[0] # <<<<<<<<<<<<<<
20521 : * if not symmetric_mode:
20522 : * graph = graph+graph.transpose()
20523 : */
20524 3 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
20525 3 : __Pyx_GOTREF(__pyx_t_1);
20526 3 : __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error)
20527 3 : __Pyx_GOTREF(__pyx_t_2);
20528 3 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20529 3 : __pyx_v_nrows = __pyx_t_2;
20530 3 : __pyx_t_2 = 0;
20531 :
20532 : /* "scipy/sparse/csgraph/_reordering.pyx":81
20533 : * raise TypeError('Input must be in CSC or CSR sparse format.')
20534 : * nrows = graph.shape[0]
20535 : * if not symmetric_mode: # <<<<<<<<<<<<<<
20536 : * graph = graph+graph.transpose()
20537 : * return _reverse_cuthill_mckee(graph.indices, graph.indptr, nrows)
20538 : */
20539 3 : __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_symmetric_mode); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 81, __pyx_L1_error)
20540 3 : __pyx_t_6 = (!__pyx_t_5);
20541 3 : if (__pyx_t_6) {
20542 :
20543 : /* "scipy/sparse/csgraph/_reordering.pyx":82
20544 : * nrows = graph.shape[0]
20545 : * if not symmetric_mode:
20546 : * graph = graph+graph.transpose() # <<<<<<<<<<<<<<
20547 : * return _reverse_cuthill_mckee(graph.indices, graph.indptr, nrows)
20548 : *
20549 : */
20550 2 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_transpose); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
20551 2 : __Pyx_GOTREF(__pyx_t_1);
20552 2 : __pyx_t_3 = NULL;
20553 2 : __pyx_t_4 = 0;
20554 : #if CYTHON_UNPACK_METHODS
20555 2 : if (likely(PyMethod_Check(__pyx_t_1))) {
20556 2 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
20557 2 : if (likely(__pyx_t_3)) {
20558 2 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
20559 2 : __Pyx_INCREF(__pyx_t_3);
20560 2 : __Pyx_INCREF(function);
20561 2 : __Pyx_DECREF_SET(__pyx_t_1, function);
20562 : __pyx_t_4 = 1;
20563 : }
20564 : }
20565 : #endif
20566 : {
20567 2 : PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
20568 2 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
20569 2 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20570 2 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error)
20571 2 : __Pyx_GOTREF(__pyx_t_2);
20572 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20573 : }
20574 2 : __pyx_t_1 = PyNumber_Add(__pyx_v_graph, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
20575 2 : __Pyx_GOTREF(__pyx_t_1);
20576 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20577 2 : __Pyx_DECREF_SET(__pyx_v_graph, __pyx_t_1);
20578 : __pyx_t_1 = 0;
20579 :
20580 : /* "scipy/sparse/csgraph/_reordering.pyx":81
20581 : * raise TypeError('Input must be in CSC or CSR sparse format.')
20582 : * nrows = graph.shape[0]
20583 : * if not symmetric_mode: # <<<<<<<<<<<<<<
20584 : * graph = graph+graph.transpose()
20585 : * return _reverse_cuthill_mckee(graph.indices, graph.indptr, nrows)
20586 : */
20587 : }
20588 :
20589 : /* "scipy/sparse/csgraph/_reordering.pyx":83
20590 : * if not symmetric_mode:
20591 : * graph = graph+graph.transpose()
20592 : * return _reverse_cuthill_mckee(graph.indices, graph.indptr, nrows) # <<<<<<<<<<<<<<
20593 : *
20594 : *
20595 : */
20596 3 : __Pyx_XDECREF(__pyx_r);
20597 3 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_reverse_cuthill_mckee); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
20598 3 : __Pyx_GOTREF(__pyx_t_2);
20599 3 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error)
20600 3 : __Pyx_GOTREF(__pyx_t_3);
20601 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_indptr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 83, __pyx_L1_error)
20602 3 : __Pyx_GOTREF(__pyx_t_7);
20603 3 : __pyx_t_8 = NULL;
20604 3 : __pyx_t_4 = 0;
20605 : #if CYTHON_UNPACK_METHODS
20606 3 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
20607 0 : __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
20608 0 : if (likely(__pyx_t_8)) {
20609 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20610 0 : __Pyx_INCREF(__pyx_t_8);
20611 0 : __Pyx_INCREF(function);
20612 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
20613 : __pyx_t_4 = 1;
20614 : }
20615 : }
20616 : #endif
20617 : {
20618 3 : PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_t_3, __pyx_t_7, __pyx_v_nrows};
20619 3 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4);
20620 3 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
20621 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20622 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20623 3 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
20624 3 : __Pyx_GOTREF(__pyx_t_1);
20625 3 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20626 : }
20627 3 : __pyx_r = __pyx_t_1;
20628 3 : __pyx_t_1 = 0;
20629 3 : goto __pyx_L0;
20630 :
20631 : /* "scipy/sparse/csgraph/_reordering.pyx":16
20632 : * include 'parameters.pxi'
20633 : *
20634 : * def reverse_cuthill_mckee(graph, symmetric_mode=False): # <<<<<<<<<<<<<<
20635 : * """
20636 : * reverse_cuthill_mckee(graph, symmetric_mode=False)
20637 : */
20638 :
20639 : /* function exit code */
20640 0 : __pyx_L1_error:;
20641 0 : __Pyx_XDECREF(__pyx_t_1);
20642 0 : __Pyx_XDECREF(__pyx_t_2);
20643 0 : __Pyx_XDECREF(__pyx_t_3);
20644 0 : __Pyx_XDECREF(__pyx_t_7);
20645 0 : __Pyx_XDECREF(__pyx_t_8);
20646 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._reordering.reverse_cuthill_mckee", __pyx_clineno, __pyx_lineno, __pyx_filename);
20647 0 : __pyx_r = NULL;
20648 3 : __pyx_L0:;
20649 3 : __Pyx_XDECREF(__pyx_v_nrows);
20650 3 : __Pyx_XDECREF(__pyx_v_graph);
20651 3 : __Pyx_XGIVEREF(__pyx_r);
20652 3 : __Pyx_RefNannyFinishContext();
20653 3 : return __pyx_r;
20654 : }
20655 :
20656 : /* "scipy/sparse/csgraph/_reordering.pyx":86
20657 : *
20658 : *
20659 : * cdef _node_degrees( # <<<<<<<<<<<<<<
20660 : * np.ndarray[int32_or_int64, ndim=1, mode="c"] ind,
20661 : * np.ndarray[int32_or_int64, ndim=1, mode="c"] ptr,
20662 : */
20663 :
20664 1 : static PyObject *__pyx_fuse_0__pyx_f_5scipy_6sparse_7csgraph_11_reordering__node_degrees(PyArrayObject *__pyx_v_ind, PyArrayObject *__pyx_v_ptr, npy_intp __pyx_v_num_rows) {
20665 1 : npy_intp __pyx_v_ii;
20666 1 : npy_intp __pyx_v_jj;
20667 1 : PyArrayObject *__pyx_v_degree = 0;
20668 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_degree;
20669 1 : __Pyx_Buffer __pyx_pybuffer_degree;
20670 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_ind;
20671 1 : __Pyx_Buffer __pyx_pybuffer_ind;
20672 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_ptr;
20673 1 : __Pyx_Buffer __pyx_pybuffer_ptr;
20674 1 : PyObject *__pyx_r = NULL;
20675 : __Pyx_RefNannyDeclarations
20676 1 : PyObject *__pyx_t_1 = NULL;
20677 1 : PyObject *__pyx_t_2 = NULL;
20678 1 : PyObject *__pyx_t_3 = NULL;
20679 1 : PyObject *__pyx_t_4 = NULL;
20680 1 : PyArrayObject *__pyx_t_5 = NULL;
20681 1 : npy_intp __pyx_t_6;
20682 1 : npy_intp __pyx_t_7;
20683 1 : npy_intp __pyx_t_8;
20684 1 : Py_ssize_t __pyx_t_9;
20685 1 : int __pyx_t_10;
20686 1 : Py_ssize_t __pyx_t_11;
20687 1 : Py_ssize_t __pyx_t_12;
20688 1 : __pyx_t_5numpy_int32_t __pyx_t_13;
20689 1 : __pyx_t_5numpy_int32_t __pyx_t_14;
20690 1 : npy_intp __pyx_t_15;
20691 1 : int __pyx_t_16;
20692 1 : int __pyx_lineno = 0;
20693 1 : const char *__pyx_filename = NULL;
20694 1 : int __pyx_clineno = 0;
20695 1 : __Pyx_RefNannySetupContext("__pyx_fuse_0_node_degrees", 1);
20696 1 : __pyx_pybuffer_degree.pybuffer.buf = NULL;
20697 1 : __pyx_pybuffer_degree.refcount = 0;
20698 1 : __pyx_pybuffernd_degree.data = NULL;
20699 1 : __pyx_pybuffernd_degree.rcbuffer = &__pyx_pybuffer_degree;
20700 1 : __pyx_pybuffer_ind.pybuffer.buf = NULL;
20701 1 : __pyx_pybuffer_ind.refcount = 0;
20702 1 : __pyx_pybuffernd_ind.data = NULL;
20703 1 : __pyx_pybuffernd_ind.rcbuffer = &__pyx_pybuffer_ind;
20704 1 : __pyx_pybuffer_ptr.pybuffer.buf = NULL;
20705 1 : __pyx_pybuffer_ptr.refcount = 0;
20706 1 : __pyx_pybuffernd_ptr.data = NULL;
20707 1 : __pyx_pybuffernd_ptr.rcbuffer = &__pyx_pybuffer_ptr;
20708 : {
20709 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
20710 1 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ind.rcbuffer->pybuffer, (PyObject*)__pyx_v_ind, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 86, __pyx_L1_error)
20711 : }
20712 1 : __pyx_pybuffernd_ind.diminfo[0].strides = __pyx_pybuffernd_ind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ind.diminfo[0].shape = __pyx_pybuffernd_ind.rcbuffer->pybuffer.shape[0];
20713 : {
20714 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
20715 1 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_ptr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 86, __pyx_L1_error)
20716 : }
20717 1 : __pyx_pybuffernd_ptr.diminfo[0].strides = __pyx_pybuffernd_ptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptr.diminfo[0].shape = __pyx_pybuffernd_ptr.rcbuffer->pybuffer.shape[0];
20718 :
20719 : /* "scipy/sparse/csgraph/_reordering.pyx":95
20720 : * """
20721 : * cdef np.npy_intp ii, jj
20722 : * cdef np.ndarray[int32_or_int64] degree = np.zeros(num_rows, dtype=ind.dtype) # <<<<<<<<<<<<<<
20723 : *
20724 : * for ii in range(num_rows):
20725 : */
20726 1 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
20727 1 : __Pyx_GOTREF(__pyx_t_1);
20728 1 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error)
20729 1 : __Pyx_GOTREF(__pyx_t_2);
20730 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20731 1 : __pyx_t_1 = __Pyx_PyInt_From_npy_intp(__pyx_v_num_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
20732 1 : __Pyx_GOTREF(__pyx_t_1);
20733 1 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
20734 1 : __Pyx_GOTREF(__pyx_t_3);
20735 1 : __Pyx_GIVEREF(__pyx_t_1);
20736 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error);
20737 1 : __pyx_t_1 = 0;
20738 1 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
20739 1 : __Pyx_GOTREF(__pyx_t_1);
20740 1 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ind), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
20741 1 : __Pyx_GOTREF(__pyx_t_4);
20742 1 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 95, __pyx_L1_error)
20743 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20744 1 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
20745 1 : __Pyx_GOTREF(__pyx_t_4);
20746 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20747 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20748 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20749 1 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 95, __pyx_L1_error)
20750 1 : __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
20751 : {
20752 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
20753 1 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_degree.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
20754 0 : __pyx_v_degree = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_degree.rcbuffer->pybuffer.buf = NULL;
20755 0 : __PYX_ERR(0, 95, __pyx_L1_error)
20756 1 : } else {__pyx_pybuffernd_degree.diminfo[0].strides = __pyx_pybuffernd_degree.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_degree.diminfo[0].shape = __pyx_pybuffernd_degree.rcbuffer->pybuffer.shape[0];
20757 : }
20758 : }
20759 1 : __pyx_t_5 = 0;
20760 1 : __pyx_v_degree = ((PyArrayObject *)__pyx_t_4);
20761 1 : __pyx_t_4 = 0;
20762 :
20763 : /* "scipy/sparse/csgraph/_reordering.pyx":97
20764 : * cdef np.ndarray[int32_or_int64] degree = np.zeros(num_rows, dtype=ind.dtype)
20765 : *
20766 : * for ii in range(num_rows): # <<<<<<<<<<<<<<
20767 : * degree[ii] = ptr[ii + 1] - ptr[ii]
20768 : * for jj in range(ptr[ii], ptr[ii + 1]):
20769 : */
20770 1 : __pyx_t_6 = __pyx_v_num_rows;
20771 1 : __pyx_t_7 = __pyx_t_6;
20772 9 : for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
20773 8 : __pyx_v_ii = __pyx_t_8;
20774 :
20775 : /* "scipy/sparse/csgraph/_reordering.pyx":98
20776 : *
20777 : * for ii in range(num_rows):
20778 : * degree[ii] = ptr[ii + 1] - ptr[ii] # <<<<<<<<<<<<<<
20779 : * for jj in range(ptr[ii], ptr[ii + 1]):
20780 : * if ind[jj] == ii:
20781 : */
20782 8 : __pyx_t_9 = (__pyx_v_ii + 1);
20783 8 : __pyx_t_10 = -1;
20784 8 : if (__pyx_t_9 < 0) {
20785 : __pyx_t_9 += __pyx_pybuffernd_ptr.diminfo[0].shape;
20786 : if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
20787 8 : } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_ptr.diminfo[0].shape)) __pyx_t_10 = 0;
20788 8 : if (unlikely(__pyx_t_10 != -1)) {
20789 0 : __Pyx_RaiseBufferIndexError(__pyx_t_10);
20790 0 : __PYX_ERR(0, 98, __pyx_L1_error)
20791 : }
20792 8 : __pyx_t_11 = __pyx_v_ii;
20793 8 : __pyx_t_10 = -1;
20794 8 : if (__pyx_t_11 < 0) {
20795 : __pyx_t_11 += __pyx_pybuffernd_ptr.diminfo[0].shape;
20796 : if (unlikely(__pyx_t_11 < 0)) __pyx_t_10 = 0;
20797 8 : } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_ptr.diminfo[0].shape)) __pyx_t_10 = 0;
20798 8 : if (unlikely(__pyx_t_10 != -1)) {
20799 0 : __Pyx_RaiseBufferIndexError(__pyx_t_10);
20800 0 : __PYX_ERR(0, 98, __pyx_L1_error)
20801 : }
20802 8 : __pyx_t_12 = __pyx_v_ii;
20803 8 : __pyx_t_10 = -1;
20804 8 : if (__pyx_t_12 < 0) {
20805 : __pyx_t_12 += __pyx_pybuffernd_degree.diminfo[0].shape;
20806 : if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 0;
20807 8 : } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_degree.diminfo[0].shape)) __pyx_t_10 = 0;
20808 8 : if (unlikely(__pyx_t_10 != -1)) {
20809 0 : __Pyx_RaiseBufferIndexError(__pyx_t_10);
20810 0 : __PYX_ERR(0, 98, __pyx_L1_error)
20811 : }
20812 8 : *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_degree.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_degree.diminfo[0].strides) = ((*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ptr.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_ptr.diminfo[0].strides)) - (*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ptr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_ptr.diminfo[0].strides)));
20813 :
20814 : /* "scipy/sparse/csgraph/_reordering.pyx":99
20815 : * for ii in range(num_rows):
20816 : * degree[ii] = ptr[ii + 1] - ptr[ii]
20817 : * for jj in range(ptr[ii], ptr[ii + 1]): # <<<<<<<<<<<<<<
20818 : * if ind[jj] == ii:
20819 : * # add one if the diagonal is in row ii
20820 : */
20821 8 : __pyx_t_11 = (__pyx_v_ii + 1);
20822 8 : __pyx_t_10 = -1;
20823 8 : if (__pyx_t_11 < 0) {
20824 : __pyx_t_11 += __pyx_pybuffernd_ptr.diminfo[0].shape;
20825 : if (unlikely(__pyx_t_11 < 0)) __pyx_t_10 = 0;
20826 8 : } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_ptr.diminfo[0].shape)) __pyx_t_10 = 0;
20827 8 : if (unlikely(__pyx_t_10 != -1)) {
20828 0 : __Pyx_RaiseBufferIndexError(__pyx_t_10);
20829 0 : __PYX_ERR(0, 99, __pyx_L1_error)
20830 : }
20831 8 : __pyx_t_13 = (*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ptr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_ptr.diminfo[0].strides));
20832 8 : __pyx_t_11 = __pyx_v_ii;
20833 8 : __pyx_t_10 = -1;
20834 8 : if (__pyx_t_11 < 0) {
20835 : __pyx_t_11 += __pyx_pybuffernd_ptr.diminfo[0].shape;
20836 : if (unlikely(__pyx_t_11 < 0)) __pyx_t_10 = 0;
20837 8 : } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_ptr.diminfo[0].shape)) __pyx_t_10 = 0;
20838 8 : if (unlikely(__pyx_t_10 != -1)) {
20839 0 : __Pyx_RaiseBufferIndexError(__pyx_t_10);
20840 0 : __PYX_ERR(0, 99, __pyx_L1_error)
20841 : }
20842 8 : __pyx_t_14 = __pyx_t_13;
20843 15 : for (__pyx_t_15 = (*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ptr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_ptr.diminfo[0].strides)); __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
20844 15 : __pyx_v_jj = __pyx_t_15;
20845 :
20846 : /* "scipy/sparse/csgraph/_reordering.pyx":100
20847 : * degree[ii] = ptr[ii + 1] - ptr[ii]
20848 : * for jj in range(ptr[ii], ptr[ii + 1]):
20849 : * if ind[jj] == ii: # <<<<<<<<<<<<<<
20850 : * # add one if the diagonal is in row ii
20851 : * degree[ii] += 1
20852 : */
20853 15 : __pyx_t_9 = __pyx_v_jj;
20854 15 : __pyx_t_10 = -1;
20855 15 : if (__pyx_t_9 < 0) {
20856 0 : __pyx_t_9 += __pyx_pybuffernd_ind.diminfo[0].shape;
20857 0 : if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
20858 15 : } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_ind.diminfo[0].shape)) __pyx_t_10 = 0;
20859 15 : if (unlikely(__pyx_t_10 != -1)) {
20860 0 : __Pyx_RaiseBufferIndexError(__pyx_t_10);
20861 0 : __PYX_ERR(0, 100, __pyx_L1_error)
20862 : }
20863 15 : __pyx_t_16 = ((*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ind.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_ind.diminfo[0].strides)) == __pyx_v_ii);
20864 15 : if (__pyx_t_16) {
20865 :
20866 : /* "scipy/sparse/csgraph/_reordering.pyx":102
20867 : * if ind[jj] == ii:
20868 : * # add one if the diagonal is in row ii
20869 : * degree[ii] += 1 # <<<<<<<<<<<<<<
20870 : * break
20871 : * return degree
20872 : */
20873 8 : __pyx_t_9 = __pyx_v_ii;
20874 8 : __pyx_t_10 = -1;
20875 8 : if (__pyx_t_9 < 0) {
20876 : __pyx_t_9 += __pyx_pybuffernd_degree.diminfo[0].shape;
20877 : if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
20878 8 : } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_degree.diminfo[0].shape)) __pyx_t_10 = 0;
20879 8 : if (unlikely(__pyx_t_10 != -1)) {
20880 0 : __Pyx_RaiseBufferIndexError(__pyx_t_10);
20881 0 : __PYX_ERR(0, 102, __pyx_L1_error)
20882 : }
20883 8 : *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_degree.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_degree.diminfo[0].strides) += 1;
20884 :
20885 : /* "scipy/sparse/csgraph/_reordering.pyx":103
20886 : * # add one if the diagonal is in row ii
20887 : * degree[ii] += 1
20888 : * break # <<<<<<<<<<<<<<
20889 : * return degree
20890 : *
20891 : */
20892 8 : goto __pyx_L6_break;
20893 :
20894 : /* "scipy/sparse/csgraph/_reordering.pyx":100
20895 : * degree[ii] = ptr[ii + 1] - ptr[ii]
20896 : * for jj in range(ptr[ii], ptr[ii + 1]):
20897 : * if ind[jj] == ii: # <<<<<<<<<<<<<<
20898 : * # add one if the diagonal is in row ii
20899 : * degree[ii] += 1
20900 : */
20901 : }
20902 : }
20903 0 : __pyx_L6_break:;
20904 : }
20905 :
20906 : /* "scipy/sparse/csgraph/_reordering.pyx":104
20907 : * degree[ii] += 1
20908 : * break
20909 : * return degree # <<<<<<<<<<<<<<
20910 : *
20911 : *
20912 : */
20913 1 : __Pyx_XDECREF(__pyx_r);
20914 1 : __Pyx_INCREF((PyObject *)__pyx_v_degree);
20915 1 : __pyx_r = ((PyObject *)__pyx_v_degree);
20916 1 : goto __pyx_L0;
20917 :
20918 : /* "scipy/sparse/csgraph/_reordering.pyx":86
20919 : *
20920 : *
20921 : * cdef _node_degrees( # <<<<<<<<<<<<<<
20922 : * np.ndarray[int32_or_int64, ndim=1, mode="c"] ind,
20923 : * np.ndarray[int32_or_int64, ndim=1, mode="c"] ptr,
20924 : */
20925 :
20926 : /* function exit code */
20927 0 : __pyx_L1_error:;
20928 0 : __Pyx_XDECREF(__pyx_t_1);
20929 0 : __Pyx_XDECREF(__pyx_t_2);
20930 0 : __Pyx_XDECREF(__pyx_t_3);
20931 0 : __Pyx_XDECREF(__pyx_t_4);
20932 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
20933 0 : __Pyx_PyThreadState_declare
20934 0 : __Pyx_PyThreadState_assign
20935 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
20936 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_degree.rcbuffer->pybuffer);
20937 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ind.rcbuffer->pybuffer);
20938 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ptr.rcbuffer->pybuffer);
20939 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
20940 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._reordering._node_degrees", __pyx_clineno, __pyx_lineno, __pyx_filename);
20941 0 : __pyx_r = 0;
20942 0 : goto __pyx_L2;
20943 1 : __pyx_L0:;
20944 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_degree.rcbuffer->pybuffer);
20945 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ind.rcbuffer->pybuffer);
20946 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ptr.rcbuffer->pybuffer);
20947 1 : __pyx_L2:;
20948 1 : __Pyx_XDECREF((PyObject *)__pyx_v_degree);
20949 1 : __Pyx_XGIVEREF(__pyx_r);
20950 1 : __Pyx_RefNannyFinishContext();
20951 1 : return __pyx_r;
20952 : }
20953 :
20954 2 : static PyObject *__pyx_fuse_1__pyx_f_5scipy_6sparse_7csgraph_11_reordering__node_degrees(PyArrayObject *__pyx_v_ind, PyArrayObject *__pyx_v_ptr, npy_intp __pyx_v_num_rows) {
20955 2 : npy_intp __pyx_v_ii;
20956 2 : npy_intp __pyx_v_jj;
20957 2 : PyArrayObject *__pyx_v_degree = 0;
20958 2 : __Pyx_LocalBuf_ND __pyx_pybuffernd_degree;
20959 2 : __Pyx_Buffer __pyx_pybuffer_degree;
20960 2 : __Pyx_LocalBuf_ND __pyx_pybuffernd_ind;
20961 2 : __Pyx_Buffer __pyx_pybuffer_ind;
20962 2 : __Pyx_LocalBuf_ND __pyx_pybuffernd_ptr;
20963 2 : __Pyx_Buffer __pyx_pybuffer_ptr;
20964 2 : PyObject *__pyx_r = NULL;
20965 : __Pyx_RefNannyDeclarations
20966 2 : PyObject *__pyx_t_1 = NULL;
20967 2 : PyObject *__pyx_t_2 = NULL;
20968 2 : PyObject *__pyx_t_3 = NULL;
20969 2 : PyObject *__pyx_t_4 = NULL;
20970 2 : PyArrayObject *__pyx_t_5 = NULL;
20971 2 : npy_intp __pyx_t_6;
20972 2 : npy_intp __pyx_t_7;
20973 2 : npy_intp __pyx_t_8;
20974 2 : Py_ssize_t __pyx_t_9;
20975 2 : int __pyx_t_10;
20976 2 : Py_ssize_t __pyx_t_11;
20977 2 : Py_ssize_t __pyx_t_12;
20978 2 : __pyx_t_5numpy_int64_t __pyx_t_13;
20979 2 : __pyx_t_5numpy_int64_t __pyx_t_14;
20980 2 : npy_intp __pyx_t_15;
20981 2 : int __pyx_t_16;
20982 2 : int __pyx_lineno = 0;
20983 2 : const char *__pyx_filename = NULL;
20984 2 : int __pyx_clineno = 0;
20985 2 : __Pyx_RefNannySetupContext("__pyx_fuse_1_node_degrees", 1);
20986 2 : __pyx_pybuffer_degree.pybuffer.buf = NULL;
20987 2 : __pyx_pybuffer_degree.refcount = 0;
20988 2 : __pyx_pybuffernd_degree.data = NULL;
20989 2 : __pyx_pybuffernd_degree.rcbuffer = &__pyx_pybuffer_degree;
20990 2 : __pyx_pybuffer_ind.pybuffer.buf = NULL;
20991 2 : __pyx_pybuffer_ind.refcount = 0;
20992 2 : __pyx_pybuffernd_ind.data = NULL;
20993 2 : __pyx_pybuffernd_ind.rcbuffer = &__pyx_pybuffer_ind;
20994 2 : __pyx_pybuffer_ptr.pybuffer.buf = NULL;
20995 2 : __pyx_pybuffer_ptr.refcount = 0;
20996 2 : __pyx_pybuffernd_ptr.data = NULL;
20997 2 : __pyx_pybuffernd_ptr.rcbuffer = &__pyx_pybuffer_ptr;
20998 : {
20999 2 : __Pyx_BufFmt_StackElem __pyx_stack[1];
21000 2 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ind.rcbuffer->pybuffer, (PyObject*)__pyx_v_ind, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 86, __pyx_L1_error)
21001 : }
21002 2 : __pyx_pybuffernd_ind.diminfo[0].strides = __pyx_pybuffernd_ind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ind.diminfo[0].shape = __pyx_pybuffernd_ind.rcbuffer->pybuffer.shape[0];
21003 : {
21004 2 : __Pyx_BufFmt_StackElem __pyx_stack[1];
21005 2 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_ptr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 86, __pyx_L1_error)
21006 : }
21007 2 : __pyx_pybuffernd_ptr.diminfo[0].strides = __pyx_pybuffernd_ptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptr.diminfo[0].shape = __pyx_pybuffernd_ptr.rcbuffer->pybuffer.shape[0];
21008 :
21009 : /* "scipy/sparse/csgraph/_reordering.pyx":95
21010 : * """
21011 : * cdef np.npy_intp ii, jj
21012 : * cdef np.ndarray[int32_or_int64] degree = np.zeros(num_rows, dtype=ind.dtype) # <<<<<<<<<<<<<<
21013 : *
21014 : * for ii in range(num_rows):
21015 : */
21016 2 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
21017 2 : __Pyx_GOTREF(__pyx_t_1);
21018 2 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error)
21019 2 : __Pyx_GOTREF(__pyx_t_2);
21020 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21021 2 : __pyx_t_1 = __Pyx_PyInt_From_npy_intp(__pyx_v_num_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
21022 2 : __Pyx_GOTREF(__pyx_t_1);
21023 2 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
21024 2 : __Pyx_GOTREF(__pyx_t_3);
21025 2 : __Pyx_GIVEREF(__pyx_t_1);
21026 2 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error);
21027 2 : __pyx_t_1 = 0;
21028 2 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
21029 2 : __Pyx_GOTREF(__pyx_t_1);
21030 2 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ind), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
21031 2 : __Pyx_GOTREF(__pyx_t_4);
21032 2 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 95, __pyx_L1_error)
21033 2 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21034 2 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
21035 2 : __Pyx_GOTREF(__pyx_t_4);
21036 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21037 2 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21038 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21039 2 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 95, __pyx_L1_error)
21040 2 : __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
21041 : {
21042 2 : __Pyx_BufFmt_StackElem __pyx_stack[1];
21043 2 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_degree.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
21044 0 : __pyx_v_degree = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_degree.rcbuffer->pybuffer.buf = NULL;
21045 0 : __PYX_ERR(0, 95, __pyx_L1_error)
21046 2 : } else {__pyx_pybuffernd_degree.diminfo[0].strides = __pyx_pybuffernd_degree.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_degree.diminfo[0].shape = __pyx_pybuffernd_degree.rcbuffer->pybuffer.shape[0];
21047 : }
21048 : }
21049 2 : __pyx_t_5 = 0;
21050 2 : __pyx_v_degree = ((PyArrayObject *)__pyx_t_4);
21051 2 : __pyx_t_4 = 0;
21052 :
21053 : /* "scipy/sparse/csgraph/_reordering.pyx":97
21054 : * cdef np.ndarray[int32_or_int64] degree = np.zeros(num_rows, dtype=ind.dtype)
21055 : *
21056 : * for ii in range(num_rows): # <<<<<<<<<<<<<<
21057 : * degree[ii] = ptr[ii + 1] - ptr[ii]
21058 : * for jj in range(ptr[ii], ptr[ii + 1]):
21059 : */
21060 2 : __pyx_t_6 = __pyx_v_num_rows;
21061 2 : __pyx_t_7 = __pyx_t_6;
21062 26 : for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
21063 24 : __pyx_v_ii = __pyx_t_8;
21064 :
21065 : /* "scipy/sparse/csgraph/_reordering.pyx":98
21066 : *
21067 : * for ii in range(num_rows):
21068 : * degree[ii] = ptr[ii + 1] - ptr[ii] # <<<<<<<<<<<<<<
21069 : * for jj in range(ptr[ii], ptr[ii + 1]):
21070 : * if ind[jj] == ii:
21071 : */
21072 24 : __pyx_t_9 = (__pyx_v_ii + 1);
21073 24 : __pyx_t_10 = -1;
21074 24 : if (__pyx_t_9 < 0) {
21075 : __pyx_t_9 += __pyx_pybuffernd_ptr.diminfo[0].shape;
21076 : if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
21077 24 : } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_ptr.diminfo[0].shape)) __pyx_t_10 = 0;
21078 24 : if (unlikely(__pyx_t_10 != -1)) {
21079 0 : __Pyx_RaiseBufferIndexError(__pyx_t_10);
21080 0 : __PYX_ERR(0, 98, __pyx_L1_error)
21081 : }
21082 24 : __pyx_t_11 = __pyx_v_ii;
21083 24 : __pyx_t_10 = -1;
21084 24 : if (__pyx_t_11 < 0) {
21085 : __pyx_t_11 += __pyx_pybuffernd_ptr.diminfo[0].shape;
21086 : if (unlikely(__pyx_t_11 < 0)) __pyx_t_10 = 0;
21087 24 : } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_ptr.diminfo[0].shape)) __pyx_t_10 = 0;
21088 24 : if (unlikely(__pyx_t_10 != -1)) {
21089 0 : __Pyx_RaiseBufferIndexError(__pyx_t_10);
21090 0 : __PYX_ERR(0, 98, __pyx_L1_error)
21091 : }
21092 24 : __pyx_t_12 = __pyx_v_ii;
21093 24 : __pyx_t_10 = -1;
21094 24 : if (__pyx_t_12 < 0) {
21095 : __pyx_t_12 += __pyx_pybuffernd_degree.diminfo[0].shape;
21096 : if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 0;
21097 24 : } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_degree.diminfo[0].shape)) __pyx_t_10 = 0;
21098 24 : if (unlikely(__pyx_t_10 != -1)) {
21099 0 : __Pyx_RaiseBufferIndexError(__pyx_t_10);
21100 0 : __PYX_ERR(0, 98, __pyx_L1_error)
21101 : }
21102 24 : *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_degree.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_degree.diminfo[0].strides) = ((*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ptr.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_ptr.diminfo[0].strides)) - (*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ptr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_ptr.diminfo[0].strides)));
21103 :
21104 : /* "scipy/sparse/csgraph/_reordering.pyx":99
21105 : * for ii in range(num_rows):
21106 : * degree[ii] = ptr[ii + 1] - ptr[ii]
21107 : * for jj in range(ptr[ii], ptr[ii + 1]): # <<<<<<<<<<<<<<
21108 : * if ind[jj] == ii:
21109 : * # add one if the diagonal is in row ii
21110 : */
21111 24 : __pyx_t_11 = (__pyx_v_ii + 1);
21112 24 : __pyx_t_10 = -1;
21113 24 : if (__pyx_t_11 < 0) {
21114 : __pyx_t_11 += __pyx_pybuffernd_ptr.diminfo[0].shape;
21115 : if (unlikely(__pyx_t_11 < 0)) __pyx_t_10 = 0;
21116 24 : } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_ptr.diminfo[0].shape)) __pyx_t_10 = 0;
21117 24 : if (unlikely(__pyx_t_10 != -1)) {
21118 0 : __Pyx_RaiseBufferIndexError(__pyx_t_10);
21119 0 : __PYX_ERR(0, 99, __pyx_L1_error)
21120 : }
21121 24 : __pyx_t_13 = (*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ptr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_ptr.diminfo[0].strides));
21122 24 : __pyx_t_11 = __pyx_v_ii;
21123 24 : __pyx_t_10 = -1;
21124 24 : if (__pyx_t_11 < 0) {
21125 : __pyx_t_11 += __pyx_pybuffernd_ptr.diminfo[0].shape;
21126 : if (unlikely(__pyx_t_11 < 0)) __pyx_t_10 = 0;
21127 24 : } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_ptr.diminfo[0].shape)) __pyx_t_10 = 0;
21128 24 : if (unlikely(__pyx_t_10 != -1)) {
21129 0 : __Pyx_RaiseBufferIndexError(__pyx_t_10);
21130 0 : __PYX_ERR(0, 99, __pyx_L1_error)
21131 : }
21132 24 : __pyx_t_14 = __pyx_t_13;
21133 58 : for (__pyx_t_15 = (*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ptr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_ptr.diminfo[0].strides)); __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
21134 57 : __pyx_v_jj = __pyx_t_15;
21135 :
21136 : /* "scipy/sparse/csgraph/_reordering.pyx":100
21137 : * degree[ii] = ptr[ii + 1] - ptr[ii]
21138 : * for jj in range(ptr[ii], ptr[ii + 1]):
21139 : * if ind[jj] == ii: # <<<<<<<<<<<<<<
21140 : * # add one if the diagonal is in row ii
21141 : * degree[ii] += 1
21142 : */
21143 57 : __pyx_t_9 = __pyx_v_jj;
21144 57 : __pyx_t_10 = -1;
21145 57 : if (__pyx_t_9 < 0) {
21146 0 : __pyx_t_9 += __pyx_pybuffernd_ind.diminfo[0].shape;
21147 0 : if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
21148 57 : } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_ind.diminfo[0].shape)) __pyx_t_10 = 0;
21149 57 : if (unlikely(__pyx_t_10 != -1)) {
21150 0 : __Pyx_RaiseBufferIndexError(__pyx_t_10);
21151 0 : __PYX_ERR(0, 100, __pyx_L1_error)
21152 : }
21153 57 : __pyx_t_16 = ((*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ind.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_ind.diminfo[0].strides)) == __pyx_v_ii);
21154 57 : if (__pyx_t_16) {
21155 :
21156 : /* "scipy/sparse/csgraph/_reordering.pyx":102
21157 : * if ind[jj] == ii:
21158 : * # add one if the diagonal is in row ii
21159 : * degree[ii] += 1 # <<<<<<<<<<<<<<
21160 : * break
21161 : * return degree
21162 : */
21163 23 : __pyx_t_9 = __pyx_v_ii;
21164 23 : __pyx_t_10 = -1;
21165 23 : if (__pyx_t_9 < 0) {
21166 : __pyx_t_9 += __pyx_pybuffernd_degree.diminfo[0].shape;
21167 : if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
21168 23 : } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_degree.diminfo[0].shape)) __pyx_t_10 = 0;
21169 23 : if (unlikely(__pyx_t_10 != -1)) {
21170 0 : __Pyx_RaiseBufferIndexError(__pyx_t_10);
21171 0 : __PYX_ERR(0, 102, __pyx_L1_error)
21172 : }
21173 23 : *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_degree.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_degree.diminfo[0].strides) += 1;
21174 :
21175 : /* "scipy/sparse/csgraph/_reordering.pyx":103
21176 : * # add one if the diagonal is in row ii
21177 : * degree[ii] += 1
21178 : * break # <<<<<<<<<<<<<<
21179 : * return degree
21180 : *
21181 : */
21182 23 : goto __pyx_L6_break;
21183 :
21184 : /* "scipy/sparse/csgraph/_reordering.pyx":100
21185 : * degree[ii] = ptr[ii + 1] - ptr[ii]
21186 : * for jj in range(ptr[ii], ptr[ii + 1]):
21187 : * if ind[jj] == ii: # <<<<<<<<<<<<<<
21188 : * # add one if the diagonal is in row ii
21189 : * degree[ii] += 1
21190 : */
21191 : }
21192 : }
21193 1 : __pyx_L6_break:;
21194 : }
21195 :
21196 : /* "scipy/sparse/csgraph/_reordering.pyx":104
21197 : * degree[ii] += 1
21198 : * break
21199 : * return degree # <<<<<<<<<<<<<<
21200 : *
21201 : *
21202 : */
21203 2 : __Pyx_XDECREF(__pyx_r);
21204 2 : __Pyx_INCREF((PyObject *)__pyx_v_degree);
21205 2 : __pyx_r = ((PyObject *)__pyx_v_degree);
21206 2 : goto __pyx_L0;
21207 :
21208 : /* "scipy/sparse/csgraph/_reordering.pyx":86
21209 : *
21210 : *
21211 : * cdef _node_degrees( # <<<<<<<<<<<<<<
21212 : * np.ndarray[int32_or_int64, ndim=1, mode="c"] ind,
21213 : * np.ndarray[int32_or_int64, ndim=1, mode="c"] ptr,
21214 : */
21215 :
21216 : /* function exit code */
21217 0 : __pyx_L1_error:;
21218 0 : __Pyx_XDECREF(__pyx_t_1);
21219 0 : __Pyx_XDECREF(__pyx_t_2);
21220 0 : __Pyx_XDECREF(__pyx_t_3);
21221 0 : __Pyx_XDECREF(__pyx_t_4);
21222 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
21223 0 : __Pyx_PyThreadState_declare
21224 0 : __Pyx_PyThreadState_assign
21225 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
21226 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_degree.rcbuffer->pybuffer);
21227 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ind.rcbuffer->pybuffer);
21228 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ptr.rcbuffer->pybuffer);
21229 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
21230 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._reordering._node_degrees", __pyx_clineno, __pyx_lineno, __pyx_filename);
21231 0 : __pyx_r = 0;
21232 0 : goto __pyx_L2;
21233 2 : __pyx_L0:;
21234 2 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_degree.rcbuffer->pybuffer);
21235 2 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ind.rcbuffer->pybuffer);
21236 2 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ptr.rcbuffer->pybuffer);
21237 2 : __pyx_L2:;
21238 2 : __Pyx_XDECREF((PyObject *)__pyx_v_degree);
21239 2 : __Pyx_XGIVEREF(__pyx_r);
21240 2 : __Pyx_RefNannyFinishContext();
21241 2 : return __pyx_r;
21242 : }
21243 :
21244 : /* "scipy/sparse/csgraph/_reordering.pyx":107
21245 : *
21246 : *
21247 : * def _reverse_cuthill_mckee(np.ndarray[int32_or_int64, ndim=1, mode="c"] ind, # <<<<<<<<<<<<<<
21248 : * np.ndarray[int32_or_int64, ndim=1, mode="c"] ptr,
21249 : * np.npy_intp num_rows):
21250 : */
21251 :
21252 : /* Python wrapper */
21253 : static PyObject *__pyx_pw_5scipy_6sparse_7csgraph_11_reordering_3_reverse_cuthill_mckee(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
21254 : PyDoc_STRVAR(__pyx_doc_5scipy_6sparse_7csgraph_11_reordering_2_reverse_cuthill_mckee, "\n Reverse Cuthill-McKee ordering of a sparse symmetric CSR or CSC matrix. \n We follow the original Cuthill-McKee paper and always start the routine\n at a node of lowest degree for each connected component.\n ");
21255 : static PyMethodDef __pyx_mdef_5scipy_6sparse_7csgraph_11_reordering_3_reverse_cuthill_mckee = {"_reverse_cuthill_mckee", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5scipy_6sparse_7csgraph_11_reordering_3_reverse_cuthill_mckee, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5scipy_6sparse_7csgraph_11_reordering_2_reverse_cuthill_mckee};
21256 3 : static PyObject *__pyx_pw_5scipy_6sparse_7csgraph_11_reordering_3_reverse_cuthill_mckee(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
21257 3 : PyObject *__pyx_v_signatures = 0;
21258 3 : PyObject *__pyx_v_args = 0;
21259 3 : PyObject *__pyx_v_kwargs = 0;
21260 3 : CYTHON_UNUSED PyObject *__pyx_v_defaults = 0;
21261 3 : PyObject *__pyx_v__fused_sigindex = 0;
21262 3 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21263 3 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21264 3 : PyObject* values[5] = {0,0,0,0,0};
21265 3 : int __pyx_lineno = 0;
21266 3 : const char *__pyx_filename = NULL;
21267 3 : int __pyx_clineno = 0;
21268 3 : PyObject *__pyx_r = 0;
21269 : __Pyx_RefNannyDeclarations
21270 3 : __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0);
21271 : #if CYTHON_ASSUME_SAFE_MACROS
21272 3 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21273 : #else
21274 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
21275 : #endif
21276 3 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
21277 : {
21278 3 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,&__pyx_n_s_fused_sigindex,0};
21279 3 : __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
21280 3 : values[4] = __Pyx_Arg_NewRef_VARARGS(__pyx_dynamic_args->__pyx_arg__fused_sigindex);
21281 3 : if (__pyx_kwds) {
21282 0 : Py_ssize_t kw_args;
21283 0 : switch (__pyx_nargs) {
21284 0 : case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
21285 0 : CYTHON_FALLTHROUGH;
21286 0 : case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
21287 0 : CYTHON_FALLTHROUGH;
21288 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
21289 0 : CYTHON_FALLTHROUGH;
21290 0 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
21291 0 : CYTHON_FALLTHROUGH;
21292 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
21293 0 : CYTHON_FALLTHROUGH;
21294 0 : case 0: break;
21295 0 : default: goto __pyx_L5_argtuple_error;
21296 : }
21297 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
21298 0 : switch (__pyx_nargs) {
21299 0 : case 0:
21300 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_signatures)) != 0)) {
21301 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
21302 0 : kw_args--;
21303 : }
21304 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L3_error)
21305 0 : else goto __pyx_L5_argtuple_error;
21306 0 : CYTHON_FALLTHROUGH;
21307 : case 1:
21308 0 : if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args)) != 0)) {
21309 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
21310 0 : kw_args--;
21311 : }
21312 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L3_error)
21313 : else {
21314 0 : __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 0, 4, 5, 1); __PYX_ERR(0, 107, __pyx_L3_error)
21315 : }
21316 0 : CYTHON_FALLTHROUGH;
21317 : case 2:
21318 0 : if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kwargs)) != 0)) {
21319 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[2]);
21320 0 : kw_args--;
21321 : }
21322 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L3_error)
21323 : else {
21324 0 : __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 0, 4, 5, 2); __PYX_ERR(0, 107, __pyx_L3_error)
21325 : }
21326 0 : CYTHON_FALLTHROUGH;
21327 : case 3:
21328 0 : if (likely((values[3] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_defaults)) != 0)) {
21329 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[3]);
21330 0 : kw_args--;
21331 : }
21332 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L3_error)
21333 : else {
21334 0 : __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 0, 4, 5, 3); __PYX_ERR(0, 107, __pyx_L3_error)
21335 : }
21336 0 : CYTHON_FALLTHROUGH;
21337 : case 4:
21338 0 : if (kw_args > 0) {
21339 0 : PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fused_sigindex);
21340 0 : if (value) { values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
21341 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L3_error)
21342 : }
21343 : }
21344 0 : if (unlikely(kw_args > 0)) {
21345 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
21346 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 107, __pyx_L3_error)
21347 : }
21348 : } else {
21349 3 : switch (__pyx_nargs) {
21350 0 : case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
21351 3 : CYTHON_FALLTHROUGH;
21352 3 : case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
21353 3 : values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
21354 3 : values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
21355 3 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
21356 3 : break;
21357 0 : default: goto __pyx_L5_argtuple_error;
21358 : }
21359 : }
21360 3 : __pyx_v_signatures = values[0];
21361 3 : __pyx_v_args = values[1];
21362 3 : __pyx_v_kwargs = values[2];
21363 3 : __pyx_v_defaults = values[3];
21364 3 : __pyx_v__fused_sigindex = values[4];
21365 : }
21366 3 : goto __pyx_L6_skip;
21367 0 : __pyx_L5_argtuple_error:;
21368 0 : __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 107, __pyx_L3_error)
21369 3 : __pyx_L6_skip:;
21370 3 : goto __pyx_L4_argument_unpacking_done;
21371 0 : __pyx_L3_error:;
21372 : {
21373 0 : Py_ssize_t __pyx_temp;
21374 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21375 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
21376 : }
21377 : }
21378 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._reordering.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
21379 0 : __Pyx_RefNannyFinishContext();
21380 0 : return NULL;
21381 3 : __pyx_L4_argument_unpacking_done:;
21382 3 : __pyx_r = __pyx_pf_5scipy_6sparse_7csgraph_11_reordering_2_reverse_cuthill_mckee(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults, __pyx_v__fused_sigindex);
21383 :
21384 : /* function exit code */
21385 : {
21386 3 : Py_ssize_t __pyx_temp;
21387 3 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21388 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
21389 : }
21390 : }
21391 : __Pyx_RefNannyFinishContext();
21392 : return __pyx_r;
21393 : }
21394 :
21395 3 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_11_reordering_2_reverse_cuthill_mckee(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults, PyObject *__pyx_v__fused_sigindex) {
21396 3 : PyObject *__pyx_v_search_list = 0;
21397 3 : PyObject *__pyx_v_sigindex_node = 0;
21398 3 : PyObject *__pyx_v_dest_sig = NULL;
21399 3 : PyTypeObject *__pyx_v_ndarray = 0;
21400 3 : PyObject *__pyx_v_arg_as_memoryview = 0;
21401 3 : __Pyx_memviewslice __pyx_v_memslice;
21402 3 : Py_ssize_t __pyx_v_itemsize;
21403 3 : int __pyx_v_dtype_signed;
21404 3 : Py_UCS4 __pyx_v_kind;
21405 3 : int __pyx_v___pyx_fused_dtype_int32__t_is_signed;
21406 3 : int __pyx_v___pyx_fused_dtype_int64__t_is_signed;
21407 3 : PyObject *__pyx_v_arg = NULL;
21408 3 : PyObject *__pyx_v_dtype = NULL;
21409 3 : PyObject *__pyx_v_arg_base = NULL;
21410 3 : PyObject *__pyx_v_sig = NULL;
21411 3 : PyObject *__pyx_v_sig_series = NULL;
21412 3 : PyObject *__pyx_v_last_type = NULL;
21413 3 : PyObject *__pyx_v_sig_type = NULL;
21414 3 : PyObject *__pyx_v_sigindex_matches = NULL;
21415 3 : PyObject *__pyx_v_sigindex_candidates = NULL;
21416 3 : PyObject *__pyx_v_dst_type = NULL;
21417 3 : PyObject *__pyx_v_found_matches = NULL;
21418 3 : PyObject *__pyx_v_found_candidates = NULL;
21419 3 : PyObject *__pyx_v_sn = NULL;
21420 3 : PyObject *__pyx_v_type_match = NULL;
21421 3 : PyObject *__pyx_v_candidates = NULL;
21422 3 : PyObject *__pyx_r = NULL;
21423 : __Pyx_RefNannyDeclarations
21424 3 : PyObject *__pyx_t_1 = NULL;
21425 3 : int __pyx_t_2;
21426 3 : int __pyx_t_3;
21427 3 : int __pyx_t_4;
21428 3 : Py_ssize_t __pyx_t_5;
21429 3 : PyObject *__pyx_t_6 = NULL;
21430 3 : long __pyx_t_7;
21431 3 : PyObject *__pyx_t_8 = NULL;
21432 3 : PyObject *__pyx_t_9 = NULL;
21433 3 : PyObject *__pyx_t_10 = NULL;
21434 3 : int __pyx_t_11;
21435 3 : __Pyx_memviewslice __pyx_t_12;
21436 3 : PyObject *__pyx_t_13 = NULL;
21437 3 : Py_ssize_t __pyx_t_14;
21438 3 : int __pyx_t_15;
21439 3 : PyObject *__pyx_t_16 = NULL;
21440 3 : PyObject *__pyx_t_17 = NULL;
21441 3 : unsigned int __pyx_t_18;
21442 3 : Py_ssize_t __pyx_t_19;
21443 3 : int __pyx_t_20;
21444 3 : int __pyx_lineno = 0;
21445 3 : const char *__pyx_filename = NULL;
21446 3 : int __pyx_clineno = 0;
21447 3 : __Pyx_RefNannySetupContext("_reverse_cuthill_mckee", 0);
21448 3 : __Pyx_INCREF(__pyx_v_kwargs);
21449 3 : __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
21450 3 : __Pyx_GOTREF(__pyx_t_1);
21451 3 : __Pyx_INCREF(Py_None);
21452 3 : __Pyx_GIVEREF(Py_None);
21453 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, Py_None)) __PYX_ERR(0, 107, __pyx_L1_error);
21454 3 : __pyx_v_dest_sig = ((PyObject*)__pyx_t_1);
21455 3 : __pyx_t_1 = 0;
21456 3 : __pyx_t_3 = (__pyx_v_kwargs != Py_None);
21457 3 : if (__pyx_t_3) {
21458 0 : } else {
21459 3 : __pyx_t_2 = __pyx_t_3;
21460 3 : goto __pyx_L4_bool_binop_done;
21461 : }
21462 0 : __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 107, __pyx_L1_error)
21463 0 : __pyx_t_4 = (!__pyx_t_3);
21464 0 : __pyx_t_2 = __pyx_t_4;
21465 3 : __pyx_L4_bool_binop_done:;
21466 3 : if (__pyx_t_2) {
21467 0 : __Pyx_INCREF(Py_None);
21468 0 : __Pyx_DECREF_SET(__pyx_v_kwargs, Py_None);
21469 : }
21470 3 : __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
21471 3 : __Pyx_GOTREF(__pyx_t_1);
21472 3 : __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1);
21473 3 : __pyx_t_1 = 0;
21474 3 : __pyx_v_itemsize = -1L;
21475 3 : __pyx_v___pyx_fused_dtype_int32__t_is_signed = (!(((__pyx_t_5numpy_int32_t)-1L) > 0));
21476 3 : __pyx_v___pyx_fused_dtype_int64__t_is_signed = (!(((__pyx_t_5numpy_int64_t)-1L) > 0));
21477 3 : if (unlikely(__pyx_v_args == Py_None)) {
21478 0 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
21479 0 : __PYX_ERR(0, 107, __pyx_L1_error)
21480 : }
21481 3 : __pyx_t_5 = __Pyx_PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 107, __pyx_L1_error)
21482 3 : __pyx_t_2 = (0 < __pyx_t_5);
21483 3 : if (__pyx_t_2) {
21484 3 : if (unlikely(__pyx_v_args == Py_None)) {
21485 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21486 : __PYX_ERR(0, 107, __pyx_L1_error)
21487 : }
21488 3 : __pyx_t_1 = __Pyx_GetItemInt_Tuple(((PyObject*)__pyx_v_args), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
21489 3 : __Pyx_GOTREF(__pyx_t_1);
21490 3 : __pyx_v_arg = __pyx_t_1;
21491 3 : __pyx_t_1 = 0;
21492 3 : goto __pyx_L6;
21493 : }
21494 0 : __pyx_t_4 = (__pyx_v_kwargs != Py_None);
21495 0 : if (__pyx_t_4) {
21496 0 : } else {
21497 0 : __pyx_t_2 = __pyx_t_4;
21498 0 : goto __pyx_L7_bool_binop_done;
21499 : }
21500 0 : if (unlikely(__pyx_v_kwargs == Py_None)) {
21501 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
21502 : __PYX_ERR(0, 107, __pyx_L1_error)
21503 : }
21504 0 : __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_ind, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 107, __pyx_L1_error)
21505 : __pyx_t_2 = __pyx_t_4;
21506 0 : __pyx_L7_bool_binop_done:;
21507 0 : if (likely(__pyx_t_2)) {
21508 0 : if (unlikely(__pyx_v_kwargs == Py_None)) {
21509 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21510 0 : __PYX_ERR(0, 107, __pyx_L1_error)
21511 : }
21512 0 : __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_ind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
21513 0 : __Pyx_GOTREF(__pyx_t_1);
21514 0 : __pyx_v_arg = __pyx_t_1;
21515 0 : __pyx_t_1 = 0;
21516 0 : goto __pyx_L6;
21517 : }
21518 : /*else*/ {
21519 0 : if (unlikely(__pyx_v_args == Py_None)) {
21520 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
21521 : __PYX_ERR(0, 107, __pyx_L1_error)
21522 : }
21523 0 : __pyx_t_5 = __Pyx_PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 107, __pyx_L1_error)
21524 0 : __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
21525 0 : __Pyx_GOTREF(__pyx_t_1);
21526 0 : __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
21527 0 : __Pyx_GOTREF(__pyx_t_6);
21528 0 : __Pyx_INCREF(__pyx_int_3);
21529 0 : __Pyx_GIVEREF(__pyx_int_3);
21530 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_3)) __PYX_ERR(0, 107, __pyx_L1_error);
21531 0 : __Pyx_INCREF(__pyx_n_s_s);
21532 0 : __Pyx_GIVEREF(__pyx_n_s_s);
21533 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_s)) __PYX_ERR(0, 107, __pyx_L1_error);
21534 0 : __Pyx_GIVEREF(__pyx_t_1);
21535 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error);
21536 0 : __pyx_t_1 = 0;
21537 0 : __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
21538 0 : __Pyx_GOTREF(__pyx_t_1);
21539 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21540 0 : __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
21541 0 : __Pyx_GOTREF(__pyx_t_6);
21542 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21543 0 : __Pyx_Raise(__pyx_t_6, 0, 0, 0);
21544 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21545 0 : __PYX_ERR(0, 107, __pyx_L1_error)
21546 : }
21547 3 : __pyx_L6:;
21548 3 : while (1) {
21549 3 : __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)Py_None));
21550 3 : if (__pyx_t_2) {
21551 3 : __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
21552 3 : if (__pyx_t_2) {
21553 3 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
21554 3 : __Pyx_GOTREF(__pyx_t_6);
21555 3 : __pyx_v_dtype = __pyx_t_6;
21556 3 : __pyx_t_6 = 0;
21557 3 : goto __pyx_L12;
21558 : }
21559 0 : __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
21560 0 : if (__pyx_t_2) {
21561 0 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
21562 0 : __Pyx_GOTREF(__pyx_t_6);
21563 0 : __pyx_v_arg_base = __pyx_t_6;
21564 0 : __pyx_t_6 = 0;
21565 0 : __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray);
21566 0 : if (__pyx_t_2) {
21567 0 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
21568 0 : __Pyx_GOTREF(__pyx_t_6);
21569 0 : __pyx_v_dtype = __pyx_t_6;
21570 0 : __pyx_t_6 = 0;
21571 0 : goto __pyx_L13;
21572 : }
21573 : /*else*/ {
21574 0 : __Pyx_INCREF(Py_None);
21575 : __pyx_v_dtype = Py_None;
21576 : }
21577 0 : __pyx_L13:;
21578 0 : goto __pyx_L12;
21579 : }
21580 : /*else*/ {
21581 0 : __Pyx_INCREF(Py_None);
21582 : __pyx_v_dtype = Py_None;
21583 : }
21584 3 : __pyx_L12:;
21585 3 : __pyx_v_itemsize = -1L;
21586 3 : __pyx_t_2 = (__pyx_v_dtype != Py_None);
21587 3 : if (__pyx_t_2) {
21588 3 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
21589 3 : __Pyx_GOTREF(__pyx_t_6);
21590 3 : __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L1_error)
21591 3 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21592 3 : __pyx_v_itemsize = __pyx_t_5;
21593 3 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
21594 3 : __Pyx_GOTREF(__pyx_t_6);
21595 3 : __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 107, __pyx_L1_error)
21596 3 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21597 3 : __pyx_v_kind = __pyx_t_7;
21598 3 : __pyx_v_dtype_signed = (__pyx_v_kind == 0x69);
21599 3 : switch (__pyx_v_kind) {
21600 3 : case 0x69:
21601 : case 0x75:
21602 3 : __pyx_t_4 = ((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize);
21603 3 : if (__pyx_t_4) {
21604 1 : } else {
21605 2 : __pyx_t_2 = __pyx_t_4;
21606 2 : goto __pyx_L16_bool_binop_done;
21607 : }
21608 1 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
21609 1 : __Pyx_GOTREF(__pyx_t_6);
21610 1 : __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L1_error)
21611 1 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21612 1 : __pyx_t_4 = (((Py_ssize_t)__pyx_t_5) == 1);
21613 1 : if (__pyx_t_4) {
21614 1 : } else {
21615 0 : __pyx_t_2 = __pyx_t_4;
21616 0 : goto __pyx_L16_bool_binop_done;
21617 : }
21618 1 : __pyx_t_4 = (!(__pyx_v___pyx_fused_dtype_int32__t_is_signed ^ __pyx_v_dtype_signed));
21619 1 : __pyx_t_2 = __pyx_t_4;
21620 3 : __pyx_L16_bool_binop_done:;
21621 3 : if (__pyx_t_2) {
21622 1 : if (unlikely((__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0))) __PYX_ERR(0, 107, __pyx_L1_error)
21623 1 : goto __pyx_L10_break;
21624 : }
21625 2 : __pyx_t_4 = ((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize);
21626 2 : if (__pyx_t_4) {
21627 2 : } else {
21628 0 : __pyx_t_2 = __pyx_t_4;
21629 0 : goto __pyx_L20_bool_binop_done;
21630 : }
21631 2 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
21632 2 : __Pyx_GOTREF(__pyx_t_6);
21633 2 : __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L1_error)
21634 2 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21635 2 : __pyx_t_4 = (((Py_ssize_t)__pyx_t_5) == 1);
21636 2 : if (__pyx_t_4) {
21637 2 : } else {
21638 0 : __pyx_t_2 = __pyx_t_4;
21639 0 : goto __pyx_L20_bool_binop_done;
21640 : }
21641 2 : __pyx_t_4 = (!(__pyx_v___pyx_fused_dtype_int64__t_is_signed ^ __pyx_v_dtype_signed));
21642 2 : __pyx_t_2 = __pyx_t_4;
21643 2 : __pyx_L20_bool_binop_done:;
21644 2 : if (__pyx_t_2) {
21645 2 : if (unlikely((__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0))) __PYX_ERR(0, 107, __pyx_L1_error)
21646 2 : goto __pyx_L10_break;
21647 : }
21648 : break;
21649 : case 0x66:
21650 : break;
21651 : case 99:
21652 : break;
21653 : case 79:
21654 : break;
21655 : default: break;
21656 : }
21657 : }
21658 : }
21659 0 : __pyx_t_2 = (__pyx_v_arg == Py_None);
21660 0 : if (__pyx_t_2) {
21661 0 : if (unlikely((__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0))) __PYX_ERR(0, 107, __pyx_L1_error)
21662 0 : goto __pyx_L10_break;
21663 : }
21664 : {
21665 0 : __Pyx_PyThreadState_declare
21666 0 : __Pyx_PyThreadState_assign
21667 0 : __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
21668 0 : __Pyx_XGOTREF(__pyx_t_8);
21669 0 : __Pyx_XGOTREF(__pyx_t_9);
21670 0 : __Pyx_XGOTREF(__pyx_t_10);
21671 : /*try:*/ {
21672 0 : __pyx_t_6 = PyMemoryView_FromObject(__pyx_v_arg); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L24_error)
21673 0 : __Pyx_GOTREF(__pyx_t_6);
21674 0 : __pyx_v_arg_as_memoryview = ((PyObject*)__pyx_t_6);
21675 0 : __pyx_t_6 = 0;
21676 : }
21677 : /*else:*/ {
21678 0 : __pyx_t_4 = (__pyx_v_itemsize == -1L);
21679 0 : if (!__pyx_t_4) {
21680 0 : goto __pyx_L35_next_or;
21681 : } else {
21682 0 : }
21683 0 : __pyx_t_5 = __Pyx_PyMemoryView_Get_itemsize(__pyx_v_arg_as_memoryview); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L26_except_error)
21684 0 : __pyx_t_4 = (__pyx_t_5 == (sizeof(__pyx_t_5numpy_int32_t)));
21685 0 : if (!__pyx_t_4) {
21686 : } else {
21687 0 : goto __pyx_L34_next_and;
21688 : }
21689 0 : __pyx_L35_next_or:;
21690 0 : __pyx_t_4 = (__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t)));
21691 0 : if (__pyx_t_4) {
21692 : } else {
21693 0 : __pyx_t_2 = __pyx_t_4;
21694 0 : goto __pyx_L33_bool_binop_done;
21695 : }
21696 0 : __pyx_L34_next_and:;
21697 0 : __pyx_t_11 = __Pyx_PyMemoryView_Get_ndim(__pyx_v_arg_as_memoryview); if (unlikely(__pyx_t_11 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L26_except_error)
21698 0 : __pyx_t_4 = (__pyx_t_11 == 1);
21699 0 : __pyx_t_2 = __pyx_t_4;
21700 0 : __pyx_L33_bool_binop_done:;
21701 0 : if (__pyx_t_2) {
21702 0 : __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg_as_memoryview, 0);
21703 0 : __pyx_v_memslice = __pyx_t_12;
21704 0 : __pyx_t_2 = (__pyx_v_memslice.memview != 0);
21705 0 : if (__pyx_t_2) {
21706 0 : __PYX_XCLEAR_MEMVIEW((&__pyx_v_memslice), 1);
21707 0 : if (unlikely((__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0))) __PYX_ERR(0, 107, __pyx_L26_except_error)
21708 0 : goto __pyx_L29_try_break;
21709 : }
21710 : /*else*/ {
21711 0 : PyErr_Clear();
21712 : }
21713 : }
21714 0 : __pyx_t_4 = (__pyx_v_itemsize == -1L);
21715 0 : if (!__pyx_t_4) {
21716 0 : goto __pyx_L41_next_or;
21717 : } else {
21718 0 : }
21719 0 : __pyx_t_5 = __Pyx_PyMemoryView_Get_itemsize(__pyx_v_arg_as_memoryview); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L26_except_error)
21720 0 : __pyx_t_4 = (__pyx_t_5 == (sizeof(__pyx_t_5numpy_int64_t)));
21721 0 : if (!__pyx_t_4) {
21722 : } else {
21723 0 : goto __pyx_L40_next_and;
21724 : }
21725 0 : __pyx_L41_next_or:;
21726 0 : __pyx_t_4 = (__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t)));
21727 0 : if (__pyx_t_4) {
21728 : } else {
21729 0 : __pyx_t_2 = __pyx_t_4;
21730 0 : goto __pyx_L39_bool_binop_done;
21731 : }
21732 0 : __pyx_L40_next_and:;
21733 0 : __pyx_t_11 = __Pyx_PyMemoryView_Get_ndim(__pyx_v_arg_as_memoryview); if (unlikely(__pyx_t_11 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L26_except_error)
21734 0 : __pyx_t_4 = (__pyx_t_11 == 1);
21735 0 : __pyx_t_2 = __pyx_t_4;
21736 0 : __pyx_L39_bool_binop_done:;
21737 0 : if (__pyx_t_2) {
21738 0 : __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg_as_memoryview, 0);
21739 0 : __pyx_v_memslice = __pyx_t_12;
21740 0 : __pyx_t_2 = (__pyx_v_memslice.memview != 0);
21741 0 : if (__pyx_t_2) {
21742 0 : __PYX_XCLEAR_MEMVIEW((&__pyx_v_memslice), 1);
21743 0 : if (unlikely((__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0))) __PYX_ERR(0, 107, __pyx_L26_except_error)
21744 0 : goto __pyx_L29_try_break;
21745 : }
21746 : /*else*/ {
21747 0 : PyErr_Clear();
21748 : }
21749 : }
21750 : }
21751 0 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21752 0 : __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
21753 0 : __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
21754 0 : goto __pyx_L31_try_end;
21755 0 : __pyx_L24_error:;
21756 0 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21757 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
21758 0 : __pyx_t_11 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_ValueError, __pyx_builtin_TypeError);
21759 0 : if (__pyx_t_11) {
21760 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._reordering.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
21761 0 : if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_1, &__pyx_t_13) < 0) __PYX_ERR(0, 107, __pyx_L26_except_error)
21762 0 : __Pyx_XGOTREF(__pyx_t_6);
21763 0 : __Pyx_XGOTREF(__pyx_t_1);
21764 0 : __Pyx_XGOTREF(__pyx_t_13);
21765 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
21766 0 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21767 0 : __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
21768 0 : goto __pyx_L25_exception_handled;
21769 : }
21770 0 : goto __pyx_L26_except_error;
21771 0 : __pyx_L26_except_error:;
21772 0 : __Pyx_XGIVEREF(__pyx_t_8);
21773 0 : __Pyx_XGIVEREF(__pyx_t_9);
21774 0 : __Pyx_XGIVEREF(__pyx_t_10);
21775 0 : __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
21776 0 : goto __pyx_L1_error;
21777 0 : __pyx_L29_try_break:;
21778 0 : __Pyx_XGIVEREF(__pyx_t_8);
21779 0 : __Pyx_XGIVEREF(__pyx_t_9);
21780 0 : __Pyx_XGIVEREF(__pyx_t_10);
21781 0 : __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
21782 0 : goto __pyx_L10_break;
21783 0 : __pyx_L25_exception_handled:;
21784 0 : __Pyx_XGIVEREF(__pyx_t_8);
21785 0 : __Pyx_XGIVEREF(__pyx_t_9);
21786 0 : __Pyx_XGIVEREF(__pyx_t_10);
21787 0 : __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
21788 0 : __pyx_L31_try_end:;
21789 : }
21790 0 : if (unlikely((__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0))) __PYX_ERR(0, 107, __pyx_L1_error)
21791 0 : goto __pyx_L10_break;
21792 : }
21793 3 : __pyx_L10_break:;
21794 3 : __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v__fused_sigindex); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 107, __pyx_L1_error)
21795 3 : __pyx_t_4 = (!__pyx_t_2);
21796 3 : if (__pyx_t_4) {
21797 1 : __pyx_t_5 = 0;
21798 1 : if (unlikely(__pyx_v_signatures == Py_None)) {
21799 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
21800 0 : __PYX_ERR(0, 107, __pyx_L1_error)
21801 : }
21802 2 : __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_14), (&__pyx_t_11)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
21803 1 : __Pyx_GOTREF(__pyx_t_1);
21804 1 : __Pyx_XDECREF(__pyx_t_13);
21805 1 : __pyx_t_13 = __pyx_t_1;
21806 1 : __pyx_t_1 = 0;
21807 3 : while (1) {
21808 3 : __pyx_t_15 = __Pyx_dict_iter_next(__pyx_t_13, __pyx_t_14, &__pyx_t_5, &__pyx_t_1, NULL, NULL, __pyx_t_11);
21809 3 : if (unlikely(__pyx_t_15 == 0)) break;
21810 2 : if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 107, __pyx_L1_error)
21811 2 : __Pyx_GOTREF(__pyx_t_1);
21812 2 : __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_1);
21813 2 : __pyx_t_1 = 0;
21814 2 : __pyx_t_1 = __pyx_v__fused_sigindex;
21815 2 : __Pyx_INCREF(__pyx_t_1);
21816 2 : __Pyx_XDECREF_SET(__pyx_v_sigindex_node, ((PyObject*)__pyx_t_1));
21817 2 : __pyx_t_1 = 0;
21818 2 : __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 107, __pyx_L1_error)
21819 2 : __Pyx_GOTREF(__pyx_t_16);
21820 2 : __pyx_t_17 = NULL;
21821 2 : __pyx_t_18 = 0;
21822 : #if CYTHON_UNPACK_METHODS
21823 2 : if (likely(PyMethod_Check(__pyx_t_16))) {
21824 0 : __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16);
21825 0 : if (likely(__pyx_t_17)) {
21826 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
21827 0 : __Pyx_INCREF(__pyx_t_17);
21828 0 : __Pyx_INCREF(function);
21829 0 : __Pyx_DECREF_SET(__pyx_t_16, function);
21830 : __pyx_t_18 = 1;
21831 : }
21832 : }
21833 : #endif
21834 : {
21835 2 : PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_kp_s__13};
21836 2 : __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_18, 1+__pyx_t_18);
21837 2 : __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
21838 2 : if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
21839 2 : __Pyx_GOTREF(__pyx_t_6);
21840 2 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
21841 : }
21842 2 : __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_split); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 107, __pyx_L1_error)
21843 2 : __Pyx_GOTREF(__pyx_t_16);
21844 2 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21845 2 : __pyx_t_6 = NULL;
21846 2 : __pyx_t_18 = 0;
21847 : #if CYTHON_UNPACK_METHODS
21848 2 : if (likely(PyMethod_Check(__pyx_t_16))) {
21849 0 : __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_16);
21850 0 : if (likely(__pyx_t_6)) {
21851 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
21852 0 : __Pyx_INCREF(__pyx_t_6);
21853 0 : __Pyx_INCREF(function);
21854 0 : __Pyx_DECREF_SET(__pyx_t_16, function);
21855 : __pyx_t_18 = 1;
21856 : }
21857 : }
21858 : #endif
21859 : {
21860 2 : PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_kp_s__14};
21861 2 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_18, 1+__pyx_t_18);
21862 2 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
21863 2 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
21864 2 : __Pyx_GOTREF(__pyx_t_1);
21865 2 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
21866 : }
21867 4 : __pyx_t_16 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 107, __pyx_L1_error)
21868 2 : __Pyx_GOTREF(__pyx_t_16);
21869 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21870 2 : __pyx_t_19 = PyList_GET_SIZE(__pyx_t_16);
21871 2 : if (unlikely(__pyx_t_19 < 1)) {
21872 0 : __Pyx_RaiseNeedMoreValuesError(0+__pyx_t_19); __PYX_ERR(0, 107, __pyx_L1_error)
21873 : }
21874 : #if CYTHON_COMPILING_IN_CPYTHON
21875 2 : __pyx_t_6 = PyList_GET_ITEM(__pyx_t_16, __pyx_t_19-1);
21876 2 : ((PyVarObject*)__pyx_t_16)->ob_size--;
21877 : #else
21878 : __pyx_t_6 = PySequence_ITEM(__pyx_t_16, __pyx_t_19-1);
21879 : #endif
21880 2 : __Pyx_GOTREF(__pyx_t_6);
21881 : #if !CYTHON_COMPILING_IN_CPYTHON
21882 : __pyx_t_17 = PySequence_GetSlice(__pyx_t_16, 0, __pyx_t_19-1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 107, __pyx_L1_error)
21883 : __Pyx_GOTREF(__pyx_t_17);
21884 : __Pyx_DECREF(__pyx_t_16);
21885 : __pyx_t_16 = __pyx_t_17; __pyx_t_17 = NULL;
21886 : #else
21887 2 : CYTHON_UNUSED_VAR(__pyx_t_17);
21888 : #endif
21889 2 : __Pyx_XDECREF_SET(__pyx_v_sig_series, ((PyObject*)__pyx_t_16));
21890 2 : __pyx_t_16 = 0;
21891 2 : __Pyx_XDECREF_SET(__pyx_v_last_type, __pyx_t_6);
21892 2 : __pyx_t_6 = 0;
21893 2 : __pyx_t_1 = __pyx_v_sig_series; __Pyx_INCREF(__pyx_t_1);
21894 : __pyx_t_19 = 0;
21895 2 : for (;;) {
21896 : {
21897 2 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
21898 : #if !CYTHON_ASSUME_SAFE_MACROS
21899 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 107, __pyx_L1_error)
21900 : #endif
21901 2 : if (__pyx_t_19 >= __pyx_temp) break;
21902 : }
21903 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21904 0 : __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_6); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 107, __pyx_L1_error)
21905 : #else
21906 : __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
21907 : __Pyx_GOTREF(__pyx_t_6);
21908 : #endif
21909 0 : __Pyx_XDECREF_SET(__pyx_v_sig_type, __pyx_t_6);
21910 0 : __pyx_t_6 = 0;
21911 0 : if (unlikely(__pyx_v_sigindex_node == Py_None)) {
21912 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
21913 0 : __PYX_ERR(0, 107, __pyx_L1_error)
21914 : }
21915 0 : __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_v_sig_type, __pyx_v_sigindex_node, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 107, __pyx_L1_error)
21916 0 : if (__pyx_t_4) {
21917 0 : __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
21918 0 : __Pyx_GOTREF(__pyx_t_6);
21919 0 : if (unlikely(__pyx_v_sigindex_node == Py_None)) {
21920 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21921 : __PYX_ERR(0, 107, __pyx_L1_error)
21922 : }
21923 0 : if (unlikely((PyDict_SetItem(__pyx_v_sigindex_node, __pyx_v_sig_type, __pyx_t_6) < 0))) __PYX_ERR(0, 107, __pyx_L1_error)
21924 0 : __Pyx_INCREF(__pyx_t_6);
21925 0 : __Pyx_DECREF_SET(__pyx_v_sigindex_node, __pyx_t_6);
21926 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21927 0 : goto __pyx_L51;
21928 : }
21929 : /*else*/ {
21930 0 : if (unlikely(__pyx_v_sigindex_node == Py_None)) {
21931 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21932 : __PYX_ERR(0, 107, __pyx_L1_error)
21933 : }
21934 0 : __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_sigindex_node, __pyx_v_sig_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
21935 0 : __Pyx_GOTREF(__pyx_t_6);
21936 0 : __pyx_t_16 = __pyx_t_6;
21937 0 : __Pyx_INCREF(__pyx_t_16);
21938 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21939 2 : __Pyx_DECREF_SET(__pyx_v_sigindex_node, ((PyObject*)__pyx_t_16));
21940 : __pyx_t_16 = 0;
21941 : }
21942 : __pyx_L51:;
21943 : }
21944 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21945 2 : if (unlikely(__pyx_v_sigindex_node == Py_None)) {
21946 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21947 0 : __PYX_ERR(0, 107, __pyx_L1_error)
21948 : }
21949 2 : if (unlikely((PyDict_SetItem(__pyx_v_sigindex_node, __pyx_v_last_type, __pyx_v_sig) < 0))) __PYX_ERR(0, 107, __pyx_L1_error)
21950 : }
21951 2 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
21952 : }
21953 3 : __pyx_t_13 = PyList_New(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 107, __pyx_L1_error)
21954 3 : __Pyx_GOTREF(__pyx_t_13);
21955 3 : __pyx_v_sigindex_matches = ((PyObject*)__pyx_t_13);
21956 3 : __pyx_t_13 = 0;
21957 3 : __pyx_t_13 = PyList_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 107, __pyx_L1_error)
21958 3 : __Pyx_GOTREF(__pyx_t_13);
21959 3 : __Pyx_INCREF(__pyx_v__fused_sigindex);
21960 3 : __Pyx_GIVEREF(__pyx_v__fused_sigindex);
21961 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_13, 0, __pyx_v__fused_sigindex)) __PYX_ERR(0, 107, __pyx_L1_error);
21962 3 : __pyx_v_sigindex_candidates = ((PyObject*)__pyx_t_13);
21963 3 : __pyx_t_13 = 0;
21964 3 : __pyx_t_13 = __pyx_v_dest_sig; __Pyx_INCREF(__pyx_t_13);
21965 : __pyx_t_14 = 0;
21966 6 : for (;;) {
21967 : {
21968 6 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_13);
21969 : #if !CYTHON_ASSUME_SAFE_MACROS
21970 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 107, __pyx_L1_error)
21971 : #endif
21972 6 : if (__pyx_t_14 >= __pyx_temp) break;
21973 : }
21974 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21975 3 : __pyx_t_1 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_14); __Pyx_INCREF(__pyx_t_1); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 107, __pyx_L1_error)
21976 : #else
21977 : __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_13, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
21978 : __Pyx_GOTREF(__pyx_t_1);
21979 : #endif
21980 3 : __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_1);
21981 3 : __pyx_t_1 = 0;
21982 3 : __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
21983 3 : __Pyx_GOTREF(__pyx_t_1);
21984 3 : __Pyx_XDECREF_SET(__pyx_v_found_matches, ((PyObject*)__pyx_t_1));
21985 3 : __pyx_t_1 = 0;
21986 3 : __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
21987 3 : __Pyx_GOTREF(__pyx_t_1);
21988 3 : __Pyx_XDECREF_SET(__pyx_v_found_candidates, ((PyObject*)__pyx_t_1));
21989 3 : __pyx_t_1 = 0;
21990 3 : __pyx_t_4 = (__pyx_v_dst_type == Py_None);
21991 3 : if (__pyx_t_4) {
21992 0 : __pyx_t_1 = __pyx_v_sigindex_matches; __Pyx_INCREF(__pyx_t_1);
21993 0 : __pyx_t_5 = 0;
21994 0 : for (;;) {
21995 : {
21996 0 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
21997 : #if !CYTHON_ASSUME_SAFE_MACROS
21998 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 107, __pyx_L1_error)
21999 : #endif
22000 0 : if (__pyx_t_5 >= __pyx_temp) break;
22001 : }
22002 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22003 0 : __pyx_t_16 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_16); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 107, __pyx_L1_error)
22004 : #else
22005 : __pyx_t_16 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 107, __pyx_L1_error)
22006 : __Pyx_GOTREF(__pyx_t_16);
22007 : #endif
22008 0 : __Pyx_XDECREF_SET(__pyx_v_sn, __pyx_t_16);
22009 0 : __pyx_t_16 = 0;
22010 0 : if (unlikely(__pyx_v_sn == Py_None)) {
22011 0 : PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
22012 0 : __PYX_ERR(0, 107, __pyx_L1_error)
22013 : }
22014 0 : __pyx_t_16 = __Pyx_PyDict_Values(((PyObject*)__pyx_v_sn)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 107, __pyx_L1_error)
22015 0 : __Pyx_GOTREF(__pyx_t_16);
22016 0 : __pyx_t_20 = __Pyx_PyList_Extend(__pyx_v_found_matches, __pyx_t_16); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 107, __pyx_L1_error)
22017 0 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
22018 : }
22019 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22020 0 : __pyx_t_1 = __pyx_v_sigindex_candidates; __Pyx_INCREF(__pyx_t_1);
22021 0 : __pyx_t_5 = 0;
22022 0 : for (;;) {
22023 : {
22024 0 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
22025 : #if !CYTHON_ASSUME_SAFE_MACROS
22026 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 107, __pyx_L1_error)
22027 : #endif
22028 0 : if (__pyx_t_5 >= __pyx_temp) break;
22029 : }
22030 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22031 0 : __pyx_t_16 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_16); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 107, __pyx_L1_error)
22032 : #else
22033 : __pyx_t_16 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 107, __pyx_L1_error)
22034 : __Pyx_GOTREF(__pyx_t_16);
22035 : #endif
22036 0 : __Pyx_XDECREF_SET(__pyx_v_sn, __pyx_t_16);
22037 0 : __pyx_t_16 = 0;
22038 0 : if (unlikely(__pyx_v_sn == Py_None)) {
22039 0 : PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
22040 0 : __PYX_ERR(0, 107, __pyx_L1_error)
22041 : }
22042 0 : __pyx_t_16 = __Pyx_PyDict_Values(((PyObject*)__pyx_v_sn)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 107, __pyx_L1_error)
22043 0 : __Pyx_GOTREF(__pyx_t_16);
22044 0 : __pyx_t_20 = __Pyx_PyList_Extend(__pyx_v_found_candidates, __pyx_t_16); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 107, __pyx_L1_error)
22045 0 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
22046 : }
22047 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22048 0 : goto __pyx_L55;
22049 : }
22050 : /*else*/ {
22051 3 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
22052 3 : __Pyx_GOTREF(__pyx_t_1);
22053 3 : __Pyx_INCREF(__pyx_v_sigindex_matches);
22054 3 : __Pyx_GIVEREF(__pyx_v_sigindex_matches);
22055 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sigindex_matches)) __PYX_ERR(0, 107, __pyx_L1_error);
22056 3 : __Pyx_INCREF(__pyx_v_sigindex_candidates);
22057 3 : __Pyx_GIVEREF(__pyx_v_sigindex_candidates);
22058 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_sigindex_candidates)) __PYX_ERR(0, 107, __pyx_L1_error);
22059 3 : __pyx_t_16 = __pyx_t_1; __Pyx_INCREF(__pyx_t_16);
22060 3 : __pyx_t_5 = 0;
22061 6 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22062 15 : for (;;) {
22063 9 : if (__pyx_t_5 >= 2) break;
22064 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22065 6 : __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_16, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 107, __pyx_L1_error)
22066 : #else
22067 : __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_16, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
22068 : __Pyx_GOTREF(__pyx_t_1);
22069 : #endif
22070 6 : __Pyx_XDECREF_SET(__pyx_v_search_list, ((PyObject*)__pyx_t_1));
22071 6 : __pyx_t_1 = 0;
22072 6 : if (unlikely(__pyx_v_search_list == Py_None)) {
22073 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
22074 0 : __PYX_ERR(0, 107, __pyx_L1_error)
22075 : }
22076 6 : __pyx_t_1 = __pyx_v_search_list; __Pyx_INCREF(__pyx_t_1);
22077 : __pyx_t_19 = 0;
22078 9 : for (;;) {
22079 : {
22080 9 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
22081 : #if !CYTHON_ASSUME_SAFE_MACROS
22082 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 107, __pyx_L1_error)
22083 : #endif
22084 9 : if (__pyx_t_19 >= __pyx_temp) break;
22085 : }
22086 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22087 3 : __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_6); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 107, __pyx_L1_error)
22088 : #else
22089 : __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
22090 : __Pyx_GOTREF(__pyx_t_6);
22091 : #endif
22092 3 : __Pyx_XDECREF_SET(__pyx_v_sn, __pyx_t_6);
22093 3 : __pyx_t_6 = 0;
22094 3 : if (unlikely(__pyx_v_sn == Py_None)) {
22095 0 : PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
22096 0 : __PYX_ERR(0, 107, __pyx_L1_error)
22097 : }
22098 3 : __pyx_t_6 = __Pyx_PyDict_GetItemDefault(((PyObject*)__pyx_v_sn), __pyx_v_dst_type, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
22099 3 : __Pyx_GOTREF(__pyx_t_6);
22100 3 : __Pyx_XDECREF_SET(__pyx_v_type_match, __pyx_t_6);
22101 3 : __pyx_t_6 = 0;
22102 3 : __pyx_t_4 = (__pyx_v_type_match != Py_None);
22103 3 : if (__pyx_t_4) {
22104 3 : __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_found_matches, __pyx_v_type_match); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 107, __pyx_L1_error)
22105 : }
22106 : }
22107 12 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22108 : }
22109 3 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
22110 : }
22111 3 : __pyx_L55:;
22112 3 : __Pyx_INCREF(__pyx_v_found_matches);
22113 3 : __Pyx_DECREF_SET(__pyx_v_sigindex_matches, __pyx_v_found_matches);
22114 3 : __Pyx_INCREF(__pyx_v_found_candidates);
22115 3 : __Pyx_DECREF_SET(__pyx_v_sigindex_candidates, __pyx_v_found_candidates);
22116 3 : __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_found_matches) != 0);
22117 3 : if (!__pyx_t_2) {
22118 0 : } else {
22119 3 : __pyx_t_4 = __pyx_t_2;
22120 3 : goto __pyx_L70_bool_binop_done;
22121 : }
22122 0 : __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_found_candidates) != 0);
22123 0 : __pyx_t_4 = __pyx_t_2;
22124 3 : __pyx_L70_bool_binop_done:;
22125 3 : __pyx_t_2 = (!__pyx_t_4);
22126 3 : if (__pyx_t_2) {
22127 0 : goto __pyx_L54_break;
22128 : }
22129 : }
22130 3 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22131 3 : goto __pyx_L72_for_end;
22132 0 : __pyx_L54_break:;
22133 0 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22134 0 : goto __pyx_L72_for_end;
22135 3 : __pyx_L72_for_end:;
22136 3 : __Pyx_INCREF(__pyx_v_sigindex_matches);
22137 3 : __pyx_v_candidates = __pyx_v_sigindex_matches;
22138 3 : __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_candidates) != 0);
22139 3 : __pyx_t_4 = (!__pyx_t_2);
22140 3 : if (unlikely(__pyx_t_4)) {
22141 0 : __pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 107, __pyx_L1_error)
22142 0 : __Pyx_GOTREF(__pyx_t_13);
22143 0 : __Pyx_Raise(__pyx_t_13, 0, 0, 0);
22144 0 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22145 0 : __PYX_ERR(0, 107, __pyx_L1_error)
22146 : }
22147 3 : __pyx_t_14 = __Pyx_PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 107, __pyx_L1_error)
22148 3 : __pyx_t_4 = (__pyx_t_14 > 1);
22149 3 : if (unlikely(__pyx_t_4)) {
22150 0 : __pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 107, __pyx_L1_error)
22151 0 : __Pyx_GOTREF(__pyx_t_13);
22152 0 : __Pyx_Raise(__pyx_t_13, 0, 0, 0);
22153 0 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22154 0 : __PYX_ERR(0, 107, __pyx_L1_error)
22155 : }
22156 : /*else*/ {
22157 3 : __Pyx_XDECREF(__pyx_r);
22158 3 : if (unlikely(__pyx_v_signatures == Py_None)) {
22159 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
22160 0 : __PYX_ERR(0, 107, __pyx_L1_error)
22161 : }
22162 3 : __pyx_t_13 = __Pyx_GetItemInt_List(__pyx_v_candidates, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 107, __pyx_L1_error)
22163 3 : __Pyx_GOTREF(__pyx_t_13);
22164 3 : __pyx_t_16 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), __pyx_t_13); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 107, __pyx_L1_error)
22165 3 : __Pyx_GOTREF(__pyx_t_16);
22166 3 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22167 3 : __pyx_r = __pyx_t_16;
22168 3 : __pyx_t_16 = 0;
22169 3 : goto __pyx_L0;
22170 : }
22171 :
22172 : /* function exit code */
22173 0 : __pyx_L1_error:;
22174 0 : __Pyx_XDECREF(__pyx_t_1);
22175 0 : __Pyx_XDECREF(__pyx_t_6);
22176 0 : __Pyx_XDECREF(__pyx_t_13);
22177 0 : __Pyx_XDECREF(__pyx_t_16);
22178 0 : __Pyx_XDECREF(__pyx_t_17);
22179 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._reordering.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
22180 0 : __pyx_r = NULL;
22181 3 : __pyx_L0:;
22182 3 : __Pyx_XDECREF(__pyx_v_search_list);
22183 3 : __Pyx_XDECREF(__pyx_v_sigindex_node);
22184 3 : __Pyx_XDECREF(__pyx_v_dest_sig);
22185 3 : __Pyx_XDECREF((PyObject *)__pyx_v_ndarray);
22186 3 : __Pyx_XDECREF(__pyx_v_arg_as_memoryview);
22187 3 : __Pyx_XDECREF(__pyx_v_arg);
22188 3 : __Pyx_XDECREF(__pyx_v_dtype);
22189 3 : __Pyx_XDECREF(__pyx_v_arg_base);
22190 3 : __Pyx_XDECREF(__pyx_v_sig);
22191 3 : __Pyx_XDECREF(__pyx_v_sig_series);
22192 3 : __Pyx_XDECREF(__pyx_v_last_type);
22193 3 : __Pyx_XDECREF(__pyx_v_sig_type);
22194 3 : __Pyx_XDECREF(__pyx_v_sigindex_matches);
22195 3 : __Pyx_XDECREF(__pyx_v_sigindex_candidates);
22196 3 : __Pyx_XDECREF(__pyx_v_dst_type);
22197 3 : __Pyx_XDECREF(__pyx_v_found_matches);
22198 3 : __Pyx_XDECREF(__pyx_v_found_candidates);
22199 3 : __Pyx_XDECREF(__pyx_v_sn);
22200 3 : __Pyx_XDECREF(__pyx_v_type_match);
22201 3 : __Pyx_XDECREF(__pyx_v_candidates);
22202 3 : __Pyx_XDECREF(__pyx_v_kwargs);
22203 3 : __Pyx_XGIVEREF(__pyx_r);
22204 3 : __Pyx_RefNannyFinishContext();
22205 3 : return __pyx_r;
22206 : }
22207 :
22208 : /* Python wrapper */
22209 : static PyObject *__pyx_fuse_0__pyx_pw_5scipy_6sparse_7csgraph_11_reordering_7_reverse_cuthill_mckee(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
22210 : static PyMethodDef __pyx_fuse_0__pyx_mdef_5scipy_6sparse_7csgraph_11_reordering_7_reverse_cuthill_mckee = {"__pyx_fuse_0_reverse_cuthill_mckee", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_fuse_0__pyx_pw_5scipy_6sparse_7csgraph_11_reordering_7_reverse_cuthill_mckee, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5scipy_6sparse_7csgraph_11_reordering_2_reverse_cuthill_mckee};
22211 1 : static PyObject *__pyx_fuse_0__pyx_pw_5scipy_6sparse_7csgraph_11_reordering_7_reverse_cuthill_mckee(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
22212 1 : PyArrayObject *__pyx_v_ind = 0;
22213 1 : PyArrayObject *__pyx_v_ptr = 0;
22214 1 : npy_intp __pyx_v_num_rows;
22215 1 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22216 1 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
22217 1 : PyObject* values[3] = {0,0,0};
22218 1 : int __pyx_lineno = 0;
22219 1 : const char *__pyx_filename = NULL;
22220 1 : int __pyx_clineno = 0;
22221 1 : PyObject *__pyx_r = 0;
22222 : __Pyx_RefNannyDeclarations
22223 1 : __Pyx_RefNannySetupContext("_reverse_cuthill_mckee (wrapper)", 0);
22224 : #if CYTHON_ASSUME_SAFE_MACROS
22225 1 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22226 : #else
22227 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
22228 : #endif
22229 1 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
22230 : {
22231 1 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ind,&__pyx_n_s_ptr,&__pyx_n_s_num_rows,0};
22232 1 : if (__pyx_kwds) {
22233 0 : Py_ssize_t kw_args;
22234 0 : switch (__pyx_nargs) {
22235 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
22236 0 : CYTHON_FALLTHROUGH;
22237 0 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
22238 0 : CYTHON_FALLTHROUGH;
22239 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
22240 0 : CYTHON_FALLTHROUGH;
22241 0 : case 0: break;
22242 0 : default: goto __pyx_L5_argtuple_error;
22243 : }
22244 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
22245 0 : switch (__pyx_nargs) {
22246 0 : case 0:
22247 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ind)) != 0)) {
22248 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
22249 0 : kw_args--;
22250 : }
22251 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L3_error)
22252 0 : else goto __pyx_L5_argtuple_error;
22253 0 : CYTHON_FALLTHROUGH;
22254 : case 1:
22255 0 : if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ptr)) != 0)) {
22256 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
22257 0 : kw_args--;
22258 : }
22259 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L3_error)
22260 : else {
22261 0 : __Pyx_RaiseArgtupleInvalid("_reverse_cuthill_mckee", 1, 3, 3, 1); __PYX_ERR(0, 107, __pyx_L3_error)
22262 : }
22263 0 : CYTHON_FALLTHROUGH;
22264 : case 2:
22265 0 : if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_num_rows)) != 0)) {
22266 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[2]);
22267 0 : kw_args--;
22268 : }
22269 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L3_error)
22270 : else {
22271 0 : __Pyx_RaiseArgtupleInvalid("_reverse_cuthill_mckee", 1, 3, 3, 2); __PYX_ERR(0, 107, __pyx_L3_error)
22272 : }
22273 : }
22274 0 : if (unlikely(kw_args > 0)) {
22275 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
22276 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_reverse_cuthill_mckee") < 0)) __PYX_ERR(0, 107, __pyx_L3_error)
22277 : }
22278 1 : } else if (unlikely(__pyx_nargs != 3)) {
22279 0 : goto __pyx_L5_argtuple_error;
22280 : } else {
22281 1 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
22282 1 : values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
22283 1 : values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
22284 : }
22285 1 : __pyx_v_ind = ((PyArrayObject *)values[0]);
22286 1 : __pyx_v_ptr = ((PyArrayObject *)values[1]);
22287 1 : __pyx_v_num_rows = __Pyx_PyInt_As_npy_intp(values[2]); if (unlikely((__pyx_v_num_rows == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 109, __pyx_L3_error)
22288 : }
22289 1 : goto __pyx_L6_skip;
22290 0 : __pyx_L5_argtuple_error:;
22291 0 : __Pyx_RaiseArgtupleInvalid("_reverse_cuthill_mckee", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 107, __pyx_L3_error)
22292 1 : __pyx_L6_skip:;
22293 1 : goto __pyx_L4_argument_unpacking_done;
22294 0 : __pyx_L3_error:;
22295 : {
22296 0 : Py_ssize_t __pyx_temp;
22297 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22298 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
22299 : }
22300 : }
22301 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._reordering._reverse_cuthill_mckee", __pyx_clineno, __pyx_lineno, __pyx_filename);
22302 0 : __Pyx_RefNannyFinishContext();
22303 0 : return NULL;
22304 1 : __pyx_L4_argument_unpacking_done:;
22305 1 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ind), __pyx_ptype_5numpy_ndarray, 1, "ind", 0))) __PYX_ERR(0, 107, __pyx_L1_error)
22306 1 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ptr), __pyx_ptype_5numpy_ndarray, 1, "ptr", 0))) __PYX_ERR(0, 108, __pyx_L1_error)
22307 1 : __pyx_r = __pyx_pf_5scipy_6sparse_7csgraph_11_reordering_6_reverse_cuthill_mckee(__pyx_self, __pyx_v_ind, __pyx_v_ptr, __pyx_v_num_rows);
22308 :
22309 : /* function exit code */
22310 1 : goto __pyx_L0;
22311 : __pyx_L1_error:;
22312 : __pyx_r = NULL;
22313 1 : __pyx_L0:;
22314 : {
22315 1 : Py_ssize_t __pyx_temp;
22316 1 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22317 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
22318 : }
22319 : }
22320 : __Pyx_RefNannyFinishContext();
22321 : return __pyx_r;
22322 : }
22323 :
22324 1 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_11_reordering_6_reverse_cuthill_mckee(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_ind, PyArrayObject *__pyx_v_ptr, npy_intp __pyx_v_num_rows) {
22325 1 : npy_intp __pyx_v_N;
22326 1 : npy_intp __pyx_v_N_old;
22327 1 : npy_intp __pyx_v_level_start;
22328 1 : npy_intp __pyx_v_level_end;
22329 1 : npy_intp __pyx_v_temp;
22330 1 : npy_intp __pyx_v_zz;
22331 1 : npy_intp __pyx_v_ii;
22332 1 : npy_intp __pyx_v_jj;
22333 1 : npy_intp __pyx_v_kk;
22334 1 : npy_intp __pyx_v_ll;
22335 1 : npy_intp __pyx_v_level_len;
22336 1 : PyArrayObject *__pyx_v_order = 0;
22337 1 : PyArrayObject *__pyx_v_degree = 0;
22338 1 : PyArrayObject *__pyx_v_inds = 0;
22339 1 : PyArrayObject *__pyx_v_rev_inds = 0;
22340 1 : PyArrayObject *__pyx_v_temp_degrees = 0;
22341 1 : __pyx_t_5numpy_int32_t __pyx_v_i;
22342 1 : __pyx_t_5numpy_int32_t __pyx_v_j;
22343 1 : __pyx_t_5numpy_int32_t __pyx_v_seed;
22344 1 : __pyx_t_5numpy_int32_t __pyx_v_temp2;
22345 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_degree;
22346 1 : __Pyx_Buffer __pyx_pybuffer_degree;
22347 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_ind;
22348 1 : __Pyx_Buffer __pyx_pybuffer_ind;
22349 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_inds;
22350 1 : __Pyx_Buffer __pyx_pybuffer_inds;
22351 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_order;
22352 1 : __Pyx_Buffer __pyx_pybuffer_order;
22353 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_ptr;
22354 1 : __Pyx_Buffer __pyx_pybuffer_ptr;
22355 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_rev_inds;
22356 1 : __Pyx_Buffer __pyx_pybuffer_rev_inds;
22357 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_temp_degrees;
22358 1 : __Pyx_Buffer __pyx_pybuffer_temp_degrees;
22359 1 : PyObject *__pyx_r = NULL;
22360 : __Pyx_RefNannyDeclarations
22361 1 : PyObject *__pyx_t_1 = NULL;
22362 1 : PyObject *__pyx_t_2 = NULL;
22363 1 : PyObject *__pyx_t_3 = NULL;
22364 1 : PyObject *__pyx_t_4 = NULL;
22365 1 : PyArrayObject *__pyx_t_5 = NULL;
22366 1 : PyArrayObject *__pyx_t_6 = NULL;
22367 1 : unsigned int __pyx_t_7;
22368 1 : PyArrayObject *__pyx_t_8 = NULL;
22369 1 : PyArrayObject *__pyx_t_9 = NULL;
22370 1 : PyArrayObject *__pyx_t_10 = NULL;
22371 1 : npy_intp __pyx_t_11;
22372 1 : npy_intp __pyx_t_12;
22373 1 : npy_intp __pyx_t_13;
22374 1 : Py_ssize_t __pyx_t_14;
22375 1 : int __pyx_t_15;
22376 1 : int __pyx_t_16;
22377 1 : Py_ssize_t __pyx_t_17;
22378 1 : npy_intp __pyx_t_18;
22379 1 : npy_intp __pyx_t_19;
22380 1 : npy_intp __pyx_t_20;
22381 1 : __pyx_t_5numpy_int32_t __pyx_t_21;
22382 1 : __pyx_t_5numpy_int32_t __pyx_t_22;
22383 1 : npy_intp __pyx_t_23;
22384 1 : Py_ssize_t __pyx_t_24;
22385 1 : npy_intp __pyx_t_25;
22386 1 : npy_intp __pyx_t_26;
22387 1 : int __pyx_t_27;
22388 1 : int __pyx_lineno = 0;
22389 1 : const char *__pyx_filename = NULL;
22390 1 : int __pyx_clineno = 0;
22391 1 : __Pyx_RefNannySetupContext("__pyx_fuse_0_reverse_cuthill_mckee", 1);
22392 1 : __pyx_pybuffer_order.pybuffer.buf = NULL;
22393 1 : __pyx_pybuffer_order.refcount = 0;
22394 1 : __pyx_pybuffernd_order.data = NULL;
22395 1 : __pyx_pybuffernd_order.rcbuffer = &__pyx_pybuffer_order;
22396 1 : __pyx_pybuffer_degree.pybuffer.buf = NULL;
22397 1 : __pyx_pybuffer_degree.refcount = 0;
22398 1 : __pyx_pybuffernd_degree.data = NULL;
22399 1 : __pyx_pybuffernd_degree.rcbuffer = &__pyx_pybuffer_degree;
22400 1 : __pyx_pybuffer_inds.pybuffer.buf = NULL;
22401 1 : __pyx_pybuffer_inds.refcount = 0;
22402 1 : __pyx_pybuffernd_inds.data = NULL;
22403 1 : __pyx_pybuffernd_inds.rcbuffer = &__pyx_pybuffer_inds;
22404 1 : __pyx_pybuffer_rev_inds.pybuffer.buf = NULL;
22405 1 : __pyx_pybuffer_rev_inds.refcount = 0;
22406 1 : __pyx_pybuffernd_rev_inds.data = NULL;
22407 1 : __pyx_pybuffernd_rev_inds.rcbuffer = &__pyx_pybuffer_rev_inds;
22408 1 : __pyx_pybuffer_temp_degrees.pybuffer.buf = NULL;
22409 1 : __pyx_pybuffer_temp_degrees.refcount = 0;
22410 1 : __pyx_pybuffernd_temp_degrees.data = NULL;
22411 1 : __pyx_pybuffernd_temp_degrees.rcbuffer = &__pyx_pybuffer_temp_degrees;
22412 1 : __pyx_pybuffer_ind.pybuffer.buf = NULL;
22413 1 : __pyx_pybuffer_ind.refcount = 0;
22414 1 : __pyx_pybuffernd_ind.data = NULL;
22415 1 : __pyx_pybuffernd_ind.rcbuffer = &__pyx_pybuffer_ind;
22416 1 : __pyx_pybuffer_ptr.pybuffer.buf = NULL;
22417 1 : __pyx_pybuffer_ptr.refcount = 0;
22418 1 : __pyx_pybuffernd_ptr.data = NULL;
22419 1 : __pyx_pybuffernd_ptr.rcbuffer = &__pyx_pybuffer_ptr;
22420 : {
22421 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
22422 1 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ind.rcbuffer->pybuffer, (PyObject*)__pyx_v_ind, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 107, __pyx_L1_error)
22423 : }
22424 1 : __pyx_pybuffernd_ind.diminfo[0].strides = __pyx_pybuffernd_ind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ind.diminfo[0].shape = __pyx_pybuffernd_ind.rcbuffer->pybuffer.shape[0];
22425 : {
22426 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
22427 1 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_ptr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 107, __pyx_L1_error)
22428 : }
22429 1 : __pyx_pybuffernd_ptr.diminfo[0].strides = __pyx_pybuffernd_ptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptr.diminfo[0].shape = __pyx_pybuffernd_ptr.rcbuffer->pybuffer.shape[0];
22430 :
22431 : /* "scipy/sparse/csgraph/_reordering.pyx":115
22432 : * at a node of lowest degree for each connected component.
22433 : * """
22434 : * cdef np.npy_intp N = 0, N_old, level_start, level_end, temp # <<<<<<<<<<<<<<
22435 : * cdef np.npy_intp zz, ii, jj, kk, ll, level_len
22436 : * cdef np.ndarray[int32_or_int64] order = np.zeros(num_rows, dtype=ind.dtype)
22437 : */
22438 1 : __pyx_v_N = 0;
22439 :
22440 : /* "scipy/sparse/csgraph/_reordering.pyx":117
22441 : * cdef np.npy_intp N = 0, N_old, level_start, level_end, temp
22442 : * cdef np.npy_intp zz, ii, jj, kk, ll, level_len
22443 : * cdef np.ndarray[int32_or_int64] order = np.zeros(num_rows, dtype=ind.dtype) # <<<<<<<<<<<<<<
22444 : * cdef np.ndarray[int32_or_int64] degree = _node_degrees(ind, ptr, num_rows)
22445 : * cdef np.ndarray[np.npy_intp] inds = np.argsort(degree)
22446 : */
22447 1 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
22448 1 : __Pyx_GOTREF(__pyx_t_1);
22449 1 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
22450 1 : __Pyx_GOTREF(__pyx_t_2);
22451 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22452 1 : __pyx_t_1 = __Pyx_PyInt_From_npy_intp(__pyx_v_num_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
22453 1 : __Pyx_GOTREF(__pyx_t_1);
22454 1 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error)
22455 1 : __Pyx_GOTREF(__pyx_t_3);
22456 1 : __Pyx_GIVEREF(__pyx_t_1);
22457 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error);
22458 1 : __pyx_t_1 = 0;
22459 1 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
22460 1 : __Pyx_GOTREF(__pyx_t_1);
22461 1 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ind), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L1_error)
22462 1 : __Pyx_GOTREF(__pyx_t_4);
22463 1 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 117, __pyx_L1_error)
22464 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22465 1 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L1_error)
22466 1 : __Pyx_GOTREF(__pyx_t_4);
22467 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22468 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22469 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22470 1 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 117, __pyx_L1_error)
22471 1 : __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
22472 : {
22473 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
22474 1 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_order.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
22475 0 : __pyx_v_order = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_order.rcbuffer->pybuffer.buf = NULL;
22476 0 : __PYX_ERR(0, 117, __pyx_L1_error)
22477 1 : } else {__pyx_pybuffernd_order.diminfo[0].strides = __pyx_pybuffernd_order.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_order.diminfo[0].shape = __pyx_pybuffernd_order.rcbuffer->pybuffer.shape[0];
22478 : }
22479 : }
22480 1 : __pyx_t_5 = 0;
22481 1 : __pyx_v_order = ((PyArrayObject *)__pyx_t_4);
22482 1 : __pyx_t_4 = 0;
22483 :
22484 : /* "scipy/sparse/csgraph/_reordering.pyx":118
22485 : * cdef np.npy_intp zz, ii, jj, kk, ll, level_len
22486 : * cdef np.ndarray[int32_or_int64] order = np.zeros(num_rows, dtype=ind.dtype)
22487 : * cdef np.ndarray[int32_or_int64] degree = _node_degrees(ind, ptr, num_rows) # <<<<<<<<<<<<<<
22488 : * cdef np.ndarray[np.npy_intp] inds = np.argsort(degree)
22489 : * cdef np.ndarray[np.npy_intp] rev_inds = np.argsort(inds)
22490 : */
22491 1 : __pyx_t_4 = __pyx_fuse_0__pyx_f_5scipy_6sparse_7csgraph_11_reordering__node_degrees(((PyArrayObject *)__pyx_v_ind), ((PyArrayObject *)__pyx_v_ptr), __pyx_v_num_rows); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L1_error)
22492 1 : __Pyx_GOTREF(__pyx_t_4);
22493 1 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 118, __pyx_L1_error)
22494 1 : __pyx_t_6 = ((PyArrayObject *)__pyx_t_4);
22495 : {
22496 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
22497 1 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_degree.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
22498 0 : __pyx_v_degree = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_degree.rcbuffer->pybuffer.buf = NULL;
22499 0 : __PYX_ERR(0, 118, __pyx_L1_error)
22500 1 : } else {__pyx_pybuffernd_degree.diminfo[0].strides = __pyx_pybuffernd_degree.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_degree.diminfo[0].shape = __pyx_pybuffernd_degree.rcbuffer->pybuffer.shape[0];
22501 : }
22502 : }
22503 1 : __pyx_t_6 = 0;
22504 1 : __pyx_v_degree = ((PyArrayObject *)__pyx_t_4);
22505 1 : __pyx_t_4 = 0;
22506 :
22507 : /* "scipy/sparse/csgraph/_reordering.pyx":119
22508 : * cdef np.ndarray[int32_or_int64] order = np.zeros(num_rows, dtype=ind.dtype)
22509 : * cdef np.ndarray[int32_or_int64] degree = _node_degrees(ind, ptr, num_rows)
22510 : * cdef np.ndarray[np.npy_intp] inds = np.argsort(degree) # <<<<<<<<<<<<<<
22511 : * cdef np.ndarray[np.npy_intp] rev_inds = np.argsort(inds)
22512 : * cdef np.ndarray[ITYPE_t] temp_degrees = np.zeros(np.max(degree), dtype=ITYPE)
22513 : */
22514 1 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
22515 1 : __Pyx_GOTREF(__pyx_t_1);
22516 1 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_argsort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error)
22517 1 : __Pyx_GOTREF(__pyx_t_3);
22518 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22519 1 : __pyx_t_1 = NULL;
22520 1 : __pyx_t_7 = 0;
22521 : #if CYTHON_UNPACK_METHODS
22522 1 : if (unlikely(PyMethod_Check(__pyx_t_3))) {
22523 0 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
22524 0 : if (likely(__pyx_t_1)) {
22525 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
22526 0 : __Pyx_INCREF(__pyx_t_1);
22527 0 : __Pyx_INCREF(function);
22528 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
22529 : __pyx_t_7 = 1;
22530 : }
22531 : }
22532 : #endif
22533 : {
22534 1 : PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_degree)};
22535 1 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
22536 1 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22537 1 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error)
22538 1 : __Pyx_GOTREF(__pyx_t_4);
22539 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22540 : }
22541 1 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 119, __pyx_L1_error)
22542 1 : __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
22543 : {
22544 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
22545 1 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn_npy_intp, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
22546 0 : __pyx_v_inds = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_inds.rcbuffer->pybuffer.buf = NULL;
22547 0 : __PYX_ERR(0, 119, __pyx_L1_error)
22548 1 : } else {__pyx_pybuffernd_inds.diminfo[0].strides = __pyx_pybuffernd_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds.diminfo[0].shape = __pyx_pybuffernd_inds.rcbuffer->pybuffer.shape[0];
22549 : }
22550 : }
22551 1 : __pyx_t_8 = 0;
22552 1 : __pyx_v_inds = ((PyArrayObject *)__pyx_t_4);
22553 1 : __pyx_t_4 = 0;
22554 :
22555 : /* "scipy/sparse/csgraph/_reordering.pyx":120
22556 : * cdef np.ndarray[int32_or_int64] degree = _node_degrees(ind, ptr, num_rows)
22557 : * cdef np.ndarray[np.npy_intp] inds = np.argsort(degree)
22558 : * cdef np.ndarray[np.npy_intp] rev_inds = np.argsort(inds) # <<<<<<<<<<<<<<
22559 : * cdef np.ndarray[ITYPE_t] temp_degrees = np.zeros(np.max(degree), dtype=ITYPE)
22560 : * cdef int32_or_int64 i, j, seed, temp2
22561 : */
22562 1 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error)
22563 1 : __Pyx_GOTREF(__pyx_t_3);
22564 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
22565 1 : __Pyx_GOTREF(__pyx_t_1);
22566 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22567 1 : __pyx_t_3 = NULL;
22568 1 : __pyx_t_7 = 0;
22569 : #if CYTHON_UNPACK_METHODS
22570 1 : if (unlikely(PyMethod_Check(__pyx_t_1))) {
22571 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
22572 0 : if (likely(__pyx_t_3)) {
22573 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
22574 0 : __Pyx_INCREF(__pyx_t_3);
22575 0 : __Pyx_INCREF(function);
22576 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
22577 : __pyx_t_7 = 1;
22578 : }
22579 : }
22580 : #endif
22581 : {
22582 1 : PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_inds)};
22583 1 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
22584 1 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
22585 1 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 120, __pyx_L1_error)
22586 1 : __Pyx_GOTREF(__pyx_t_4);
22587 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22588 : }
22589 1 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 120, __pyx_L1_error)
22590 1 : __pyx_t_9 = ((PyArrayObject *)__pyx_t_4);
22591 : {
22592 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
22593 1 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rev_inds.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_npy_intp, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
22594 0 : __pyx_v_rev_inds = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_rev_inds.rcbuffer->pybuffer.buf = NULL;
22595 0 : __PYX_ERR(0, 120, __pyx_L1_error)
22596 1 : } else {__pyx_pybuffernd_rev_inds.diminfo[0].strides = __pyx_pybuffernd_rev_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rev_inds.diminfo[0].shape = __pyx_pybuffernd_rev_inds.rcbuffer->pybuffer.shape[0];
22597 : }
22598 : }
22599 1 : __pyx_t_9 = 0;
22600 1 : __pyx_v_rev_inds = ((PyArrayObject *)__pyx_t_4);
22601 1 : __pyx_t_4 = 0;
22602 :
22603 : /* "scipy/sparse/csgraph/_reordering.pyx":121
22604 : * cdef np.ndarray[np.npy_intp] inds = np.argsort(degree)
22605 : * cdef np.ndarray[np.npy_intp] rev_inds = np.argsort(inds)
22606 : * cdef np.ndarray[ITYPE_t] temp_degrees = np.zeros(np.max(degree), dtype=ITYPE) # <<<<<<<<<<<<<<
22607 : * cdef int32_or_int64 i, j, seed, temp2
22608 : *
22609 : */
22610 1 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error)
22611 1 : __Pyx_GOTREF(__pyx_t_4);
22612 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
22613 1 : __Pyx_GOTREF(__pyx_t_1);
22614 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22615 1 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
22616 1 : __Pyx_GOTREF(__pyx_t_3);
22617 1 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
22618 1 : __Pyx_GOTREF(__pyx_t_2);
22619 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22620 1 : __pyx_t_3 = NULL;
22621 1 : __pyx_t_7 = 0;
22622 : #if CYTHON_UNPACK_METHODS
22623 1 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
22624 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
22625 0 : if (likely(__pyx_t_3)) {
22626 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
22627 0 : __Pyx_INCREF(__pyx_t_3);
22628 0 : __Pyx_INCREF(function);
22629 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
22630 : __pyx_t_7 = 1;
22631 : }
22632 : }
22633 : #endif
22634 : {
22635 1 : PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_degree)};
22636 1 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
22637 1 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
22638 1 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error)
22639 1 : __Pyx_GOTREF(__pyx_t_4);
22640 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22641 : }
22642 1 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
22643 1 : __Pyx_GOTREF(__pyx_t_2);
22644 1 : __Pyx_GIVEREF(__pyx_t_4);
22645 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error);
22646 1 : __pyx_t_4 = 0;
22647 1 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error)
22648 1 : __Pyx_GOTREF(__pyx_t_4);
22649 1 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
22650 1 : __Pyx_GOTREF(__pyx_t_3);
22651 1 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 121, __pyx_L1_error)
22652 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22653 1 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
22654 1 : __Pyx_GOTREF(__pyx_t_3);
22655 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22656 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22657 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22658 1 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 121, __pyx_L1_error)
22659 1 : __pyx_t_10 = ((PyArrayObject *)__pyx_t_3);
22660 : {
22661 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
22662 1 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_temp_degrees.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5scipy_6sparse_7csgraph_11_reordering_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
22663 0 : __pyx_v_temp_degrees = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_temp_degrees.rcbuffer->pybuffer.buf = NULL;
22664 0 : __PYX_ERR(0, 121, __pyx_L1_error)
22665 1 : } else {__pyx_pybuffernd_temp_degrees.diminfo[0].strides = __pyx_pybuffernd_temp_degrees.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_temp_degrees.diminfo[0].shape = __pyx_pybuffernd_temp_degrees.rcbuffer->pybuffer.shape[0];
22666 : }
22667 : }
22668 1 : __pyx_t_10 = 0;
22669 1 : __pyx_v_temp_degrees = ((PyArrayObject *)__pyx_t_3);
22670 1 : __pyx_t_3 = 0;
22671 :
22672 : /* "scipy/sparse/csgraph/_reordering.pyx":125
22673 : *
22674 : * # loop over zz takes into account possible disconnected graph.
22675 : * for zz in range(num_rows): # <<<<<<<<<<<<<<
22676 : * if inds[zz] != -1: # Do BFS with seed=inds[zz]
22677 : * seed = inds[zz]
22678 : */
22679 1 : __pyx_t_11 = __pyx_v_num_rows;
22680 1 : __pyx_t_12 = __pyx_t_11;
22681 2 : for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
22682 2 : __pyx_v_zz = __pyx_t_13;
22683 :
22684 : /* "scipy/sparse/csgraph/_reordering.pyx":126
22685 : * # loop over zz takes into account possible disconnected graph.
22686 : * for zz in range(num_rows):
22687 : * if inds[zz] != -1: # Do BFS with seed=inds[zz] # <<<<<<<<<<<<<<
22688 : * seed = inds[zz]
22689 : * order[N] = seed
22690 : */
22691 2 : __pyx_t_14 = __pyx_v_zz;
22692 2 : __pyx_t_15 = -1;
22693 2 : if (__pyx_t_14 < 0) {
22694 : __pyx_t_14 += __pyx_pybuffernd_inds.diminfo[0].shape;
22695 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
22696 2 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_inds.diminfo[0].shape)) __pyx_t_15 = 0;
22697 2 : if (unlikely(__pyx_t_15 != -1)) {
22698 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
22699 0 : __PYX_ERR(0, 126, __pyx_L1_error)
22700 : }
22701 2 : __pyx_t_16 = ((*__Pyx_BufPtrStrided1d(npy_intp *, __pyx_pybuffernd_inds.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_inds.diminfo[0].strides)) != -1L);
22702 2 : if (__pyx_t_16) {
22703 :
22704 : /* "scipy/sparse/csgraph/_reordering.pyx":127
22705 : * for zz in range(num_rows):
22706 : * if inds[zz] != -1: # Do BFS with seed=inds[zz]
22707 : * seed = inds[zz] # <<<<<<<<<<<<<<
22708 : * order[N] = seed
22709 : * N += 1
22710 : */
22711 2 : __pyx_t_14 = __pyx_v_zz;
22712 2 : __pyx_t_15 = -1;
22713 2 : if (__pyx_t_14 < 0) {
22714 : __pyx_t_14 += __pyx_pybuffernd_inds.diminfo[0].shape;
22715 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
22716 2 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_inds.diminfo[0].shape)) __pyx_t_15 = 0;
22717 2 : if (unlikely(__pyx_t_15 != -1)) {
22718 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
22719 0 : __PYX_ERR(0, 127, __pyx_L1_error)
22720 : }
22721 2 : __pyx_v_seed = (*__Pyx_BufPtrStrided1d(npy_intp *, __pyx_pybuffernd_inds.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_inds.diminfo[0].strides));
22722 :
22723 : /* "scipy/sparse/csgraph/_reordering.pyx":128
22724 : * if inds[zz] != -1: # Do BFS with seed=inds[zz]
22725 : * seed = inds[zz]
22726 : * order[N] = seed # <<<<<<<<<<<<<<
22727 : * N += 1
22728 : * inds[rev_inds[seed]] = -1
22729 : */
22730 2 : __pyx_t_14 = __pyx_v_N;
22731 2 : __pyx_t_15 = -1;
22732 2 : if (__pyx_t_14 < 0) {
22733 0 : __pyx_t_14 += __pyx_pybuffernd_order.diminfo[0].shape;
22734 0 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
22735 2 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_order.diminfo[0].shape)) __pyx_t_15 = 0;
22736 2 : if (unlikely(__pyx_t_15 != -1)) {
22737 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
22738 0 : __PYX_ERR(0, 128, __pyx_L1_error)
22739 : }
22740 2 : *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_order.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_order.diminfo[0].strides) = __pyx_v_seed;
22741 :
22742 : /* "scipy/sparse/csgraph/_reordering.pyx":129
22743 : * seed = inds[zz]
22744 : * order[N] = seed
22745 : * N += 1 # <<<<<<<<<<<<<<
22746 : * inds[rev_inds[seed]] = -1
22747 : * level_start = N - 1
22748 : */
22749 2 : __pyx_v_N = (__pyx_v_N + 1);
22750 :
22751 : /* "scipy/sparse/csgraph/_reordering.pyx":130
22752 : * order[N] = seed
22753 : * N += 1
22754 : * inds[rev_inds[seed]] = -1 # <<<<<<<<<<<<<<
22755 : * level_start = N - 1
22756 : * level_end = N
22757 : */
22758 2 : __pyx_t_14 = __pyx_v_seed;
22759 2 : __pyx_t_15 = -1;
22760 2 : if (__pyx_t_14 < 0) {
22761 0 : __pyx_t_14 += __pyx_pybuffernd_rev_inds.diminfo[0].shape;
22762 0 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
22763 2 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_rev_inds.diminfo[0].shape)) __pyx_t_15 = 0;
22764 2 : if (unlikely(__pyx_t_15 != -1)) {
22765 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
22766 0 : __PYX_ERR(0, 130, __pyx_L1_error)
22767 : }
22768 2 : __pyx_t_17 = (*__Pyx_BufPtrStrided1d(npy_intp *, __pyx_pybuffernd_rev_inds.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_rev_inds.diminfo[0].strides));
22769 2 : __pyx_t_15 = -1;
22770 2 : if (__pyx_t_17 < 0) {
22771 0 : __pyx_t_17 += __pyx_pybuffernd_inds.diminfo[0].shape;
22772 0 : if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 0;
22773 2 : } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_inds.diminfo[0].shape)) __pyx_t_15 = 0;
22774 2 : if (unlikely(__pyx_t_15 != -1)) {
22775 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
22776 0 : __PYX_ERR(0, 130, __pyx_L1_error)
22777 : }
22778 2 : *__Pyx_BufPtrStrided1d(npy_intp *, __pyx_pybuffernd_inds.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_inds.diminfo[0].strides) = -1L;
22779 :
22780 : /* "scipy/sparse/csgraph/_reordering.pyx":131
22781 : * N += 1
22782 : * inds[rev_inds[seed]] = -1
22783 : * level_start = N - 1 # <<<<<<<<<<<<<<
22784 : * level_end = N
22785 : *
22786 : */
22787 2 : __pyx_v_level_start = (__pyx_v_N - 1);
22788 :
22789 : /* "scipy/sparse/csgraph/_reordering.pyx":132
22790 : * inds[rev_inds[seed]] = -1
22791 : * level_start = N - 1
22792 : * level_end = N # <<<<<<<<<<<<<<
22793 : *
22794 : * while level_start < level_end:
22795 : */
22796 2 : __pyx_v_level_end = __pyx_v_N;
22797 :
22798 : /* "scipy/sparse/csgraph/_reordering.pyx":134
22799 : * level_end = N
22800 : *
22801 : * while level_start < level_end: # <<<<<<<<<<<<<<
22802 : * for ii in range(level_start, level_end):
22803 : * i = order[ii]
22804 : */
22805 9 : while (1) {
22806 9 : __pyx_t_16 = (__pyx_v_level_start < __pyx_v_level_end);
22807 9 : if (!__pyx_t_16) break;
22808 :
22809 : /* "scipy/sparse/csgraph/_reordering.pyx":135
22810 : *
22811 : * while level_start < level_end:
22812 : * for ii in range(level_start, level_end): # <<<<<<<<<<<<<<
22813 : * i = order[ii]
22814 : * N_old = N
22815 : */
22816 : __pyx_t_18 = __pyx_v_level_end;
22817 : __pyx_t_19 = __pyx_t_18;
22818 15 : for (__pyx_t_20 = __pyx_v_level_start; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
22819 8 : __pyx_v_ii = __pyx_t_20;
22820 :
22821 : /* "scipy/sparse/csgraph/_reordering.pyx":136
22822 : * while level_start < level_end:
22823 : * for ii in range(level_start, level_end):
22824 : * i = order[ii] # <<<<<<<<<<<<<<
22825 : * N_old = N
22826 : *
22827 : */
22828 8 : __pyx_t_14 = __pyx_v_ii;
22829 8 : __pyx_t_15 = -1;
22830 8 : if (__pyx_t_14 < 0) {
22831 0 : __pyx_t_14 += __pyx_pybuffernd_order.diminfo[0].shape;
22832 0 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
22833 8 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_order.diminfo[0].shape)) __pyx_t_15 = 0;
22834 8 : if (unlikely(__pyx_t_15 != -1)) {
22835 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
22836 0 : __PYX_ERR(0, 136, __pyx_L1_error)
22837 : }
22838 8 : __pyx_v_i = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_order.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_order.diminfo[0].strides));
22839 :
22840 : /* "scipy/sparse/csgraph/_reordering.pyx":137
22841 : * for ii in range(level_start, level_end):
22842 : * i = order[ii]
22843 : * N_old = N # <<<<<<<<<<<<<<
22844 : *
22845 : * # add unvisited neighbors
22846 : */
22847 8 : __pyx_v_N_old = __pyx_v_N;
22848 :
22849 : /* "scipy/sparse/csgraph/_reordering.pyx":140
22850 : *
22851 : * # add unvisited neighbors
22852 : * for jj in range(ptr[i], ptr[i + 1]): # <<<<<<<<<<<<<<
22853 : * # j is node number connected to i
22854 : * j = ind[jj]
22855 : */
22856 8 : __pyx_t_14 = (__pyx_v_i + 1);
22857 8 : __pyx_t_15 = -1;
22858 8 : if (__pyx_t_14 < 0) {
22859 0 : __pyx_t_14 += __pyx_pybuffernd_ptr.diminfo[0].shape;
22860 0 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
22861 8 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_ptr.diminfo[0].shape)) __pyx_t_15 = 0;
22862 8 : if (unlikely(__pyx_t_15 != -1)) {
22863 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
22864 0 : __PYX_ERR(0, 140, __pyx_L1_error)
22865 : }
22866 8 : __pyx_t_21 = (*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ptr.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_ptr.diminfo[0].strides));
22867 8 : __pyx_t_14 = __pyx_v_i;
22868 8 : __pyx_t_15 = -1;
22869 8 : if (__pyx_t_14 < 0) {
22870 0 : __pyx_t_14 += __pyx_pybuffernd_ptr.diminfo[0].shape;
22871 0 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
22872 8 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_ptr.diminfo[0].shape)) __pyx_t_15 = 0;
22873 8 : if (unlikely(__pyx_t_15 != -1)) {
22874 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
22875 0 : __PYX_ERR(0, 140, __pyx_L1_error)
22876 : }
22877 8 : __pyx_t_22 = __pyx_t_21;
22878 30 : for (__pyx_t_23 = (*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ptr.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_ptr.diminfo[0].strides)); __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) {
22879 22 : __pyx_v_jj = __pyx_t_23;
22880 :
22881 : /* "scipy/sparse/csgraph/_reordering.pyx":142
22882 : * for jj in range(ptr[i], ptr[i + 1]):
22883 : * # j is node number connected to i
22884 : * j = ind[jj] # <<<<<<<<<<<<<<
22885 : * if inds[rev_inds[j]] != -1:
22886 : * inds[rev_inds[j]] = -1
22887 : */
22888 22 : __pyx_t_17 = __pyx_v_jj;
22889 22 : __pyx_t_15 = -1;
22890 22 : if (__pyx_t_17 < 0) {
22891 0 : __pyx_t_17 += __pyx_pybuffernd_ind.diminfo[0].shape;
22892 0 : if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 0;
22893 22 : } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_ind.diminfo[0].shape)) __pyx_t_15 = 0;
22894 22 : if (unlikely(__pyx_t_15 != -1)) {
22895 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
22896 0 : __PYX_ERR(0, 142, __pyx_L1_error)
22897 : }
22898 22 : __pyx_v_j = (*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ind.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_ind.diminfo[0].strides));
22899 :
22900 : /* "scipy/sparse/csgraph/_reordering.pyx":143
22901 : * # j is node number connected to i
22902 : * j = ind[jj]
22903 : * if inds[rev_inds[j]] != -1: # <<<<<<<<<<<<<<
22904 : * inds[rev_inds[j]] = -1
22905 : * order[N] = j
22906 : */
22907 22 : __pyx_t_17 = __pyx_v_j;
22908 22 : __pyx_t_15 = -1;
22909 22 : if (__pyx_t_17 < 0) {
22910 0 : __pyx_t_17 += __pyx_pybuffernd_rev_inds.diminfo[0].shape;
22911 0 : if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 0;
22912 22 : } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_rev_inds.diminfo[0].shape)) __pyx_t_15 = 0;
22913 22 : if (unlikely(__pyx_t_15 != -1)) {
22914 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
22915 0 : __PYX_ERR(0, 143, __pyx_L1_error)
22916 : }
22917 22 : __pyx_t_24 = (*__Pyx_BufPtrStrided1d(npy_intp *, __pyx_pybuffernd_rev_inds.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_rev_inds.diminfo[0].strides));
22918 22 : __pyx_t_15 = -1;
22919 22 : if (__pyx_t_24 < 0) {
22920 0 : __pyx_t_24 += __pyx_pybuffernd_inds.diminfo[0].shape;
22921 0 : if (unlikely(__pyx_t_24 < 0)) __pyx_t_15 = 0;
22922 22 : } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_inds.diminfo[0].shape)) __pyx_t_15 = 0;
22923 22 : if (unlikely(__pyx_t_15 != -1)) {
22924 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
22925 0 : __PYX_ERR(0, 143, __pyx_L1_error)
22926 : }
22927 22 : __pyx_t_16 = ((*__Pyx_BufPtrStrided1d(npy_intp *, __pyx_pybuffernd_inds.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_inds.diminfo[0].strides)) != -1L);
22928 22 : if (__pyx_t_16) {
22929 :
22930 : /* "scipy/sparse/csgraph/_reordering.pyx":144
22931 : * j = ind[jj]
22932 : * if inds[rev_inds[j]] != -1:
22933 : * inds[rev_inds[j]] = -1 # <<<<<<<<<<<<<<
22934 : * order[N] = j
22935 : * N += 1
22936 : */
22937 6 : __pyx_t_17 = __pyx_v_j;
22938 6 : __pyx_t_15 = -1;
22939 6 : if (__pyx_t_17 < 0) {
22940 0 : __pyx_t_17 += __pyx_pybuffernd_rev_inds.diminfo[0].shape;
22941 0 : if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 0;
22942 6 : } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_rev_inds.diminfo[0].shape)) __pyx_t_15 = 0;
22943 6 : if (unlikely(__pyx_t_15 != -1)) {
22944 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
22945 0 : __PYX_ERR(0, 144, __pyx_L1_error)
22946 : }
22947 6 : __pyx_t_24 = (*__Pyx_BufPtrStrided1d(npy_intp *, __pyx_pybuffernd_rev_inds.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_rev_inds.diminfo[0].strides));
22948 6 : __pyx_t_15 = -1;
22949 6 : if (__pyx_t_24 < 0) {
22950 0 : __pyx_t_24 += __pyx_pybuffernd_inds.diminfo[0].shape;
22951 0 : if (unlikely(__pyx_t_24 < 0)) __pyx_t_15 = 0;
22952 6 : } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_inds.diminfo[0].shape)) __pyx_t_15 = 0;
22953 6 : if (unlikely(__pyx_t_15 != -1)) {
22954 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
22955 0 : __PYX_ERR(0, 144, __pyx_L1_error)
22956 : }
22957 6 : *__Pyx_BufPtrStrided1d(npy_intp *, __pyx_pybuffernd_inds.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_inds.diminfo[0].strides) = -1L;
22958 :
22959 : /* "scipy/sparse/csgraph/_reordering.pyx":145
22960 : * if inds[rev_inds[j]] != -1:
22961 : * inds[rev_inds[j]] = -1
22962 : * order[N] = j # <<<<<<<<<<<<<<
22963 : * N += 1
22964 : *
22965 : */
22966 6 : __pyx_t_17 = __pyx_v_N;
22967 6 : __pyx_t_15 = -1;
22968 6 : if (__pyx_t_17 < 0) {
22969 0 : __pyx_t_17 += __pyx_pybuffernd_order.diminfo[0].shape;
22970 0 : if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 0;
22971 6 : } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_order.diminfo[0].shape)) __pyx_t_15 = 0;
22972 6 : if (unlikely(__pyx_t_15 != -1)) {
22973 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
22974 0 : __PYX_ERR(0, 145, __pyx_L1_error)
22975 : }
22976 6 : *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_order.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_order.diminfo[0].strides) = __pyx_v_j;
22977 :
22978 : /* "scipy/sparse/csgraph/_reordering.pyx":146
22979 : * inds[rev_inds[j]] = -1
22980 : * order[N] = j
22981 : * N += 1 # <<<<<<<<<<<<<<
22982 : *
22983 : * # Add values to temp_degrees array for insertion sort
22984 : */
22985 6 : __pyx_v_N = (__pyx_v_N + 1);
22986 :
22987 : /* "scipy/sparse/csgraph/_reordering.pyx":143
22988 : * # j is node number connected to i
22989 : * j = ind[jj]
22990 : * if inds[rev_inds[j]] != -1: # <<<<<<<<<<<<<<
22991 : * inds[rev_inds[j]] = -1
22992 : * order[N] = j
22993 : */
22994 : }
22995 : }
22996 :
22997 : /* "scipy/sparse/csgraph/_reordering.pyx":149
22998 : *
22999 : * # Add values to temp_degrees array for insertion sort
23000 : * level_len = 0 # <<<<<<<<<<<<<<
23001 : * for kk in range(N_old, N):
23002 : * temp_degrees[level_len] = degree[order[kk]]
23003 : */
23004 : __pyx_v_level_len = 0;
23005 :
23006 : /* "scipy/sparse/csgraph/_reordering.pyx":150
23007 : * # Add values to temp_degrees array for insertion sort
23008 : * level_len = 0
23009 : * for kk in range(N_old, N): # <<<<<<<<<<<<<<
23010 : * temp_degrees[level_len] = degree[order[kk]]
23011 : * level_len += 1
23012 : */
23013 14 : __pyx_t_23 = __pyx_v_N;
23014 : __pyx_t_25 = __pyx_t_23;
23015 14 : for (__pyx_t_26 = __pyx_v_N_old; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
23016 6 : __pyx_v_kk = __pyx_t_26;
23017 :
23018 : /* "scipy/sparse/csgraph/_reordering.pyx":151
23019 : * level_len = 0
23020 : * for kk in range(N_old, N):
23021 : * temp_degrees[level_len] = degree[order[kk]] # <<<<<<<<<<<<<<
23022 : * level_len += 1
23023 : *
23024 : */
23025 6 : __pyx_t_14 = __pyx_v_kk;
23026 6 : __pyx_t_15 = -1;
23027 6 : if (__pyx_t_14 < 0) {
23028 0 : __pyx_t_14 += __pyx_pybuffernd_order.diminfo[0].shape;
23029 0 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
23030 6 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_order.diminfo[0].shape)) __pyx_t_15 = 0;
23031 6 : if (unlikely(__pyx_t_15 != -1)) {
23032 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
23033 0 : __PYX_ERR(0, 151, __pyx_L1_error)
23034 : }
23035 6 : __pyx_t_17 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_order.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_order.diminfo[0].strides));
23036 6 : __pyx_t_15 = -1;
23037 6 : if (__pyx_t_17 < 0) {
23038 0 : __pyx_t_17 += __pyx_pybuffernd_degree.diminfo[0].shape;
23039 0 : if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 0;
23040 6 : } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_degree.diminfo[0].shape)) __pyx_t_15 = 0;
23041 6 : if (unlikely(__pyx_t_15 != -1)) {
23042 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
23043 0 : __PYX_ERR(0, 151, __pyx_L1_error)
23044 : }
23045 6 : __pyx_t_24 = __pyx_v_level_len;
23046 6 : __pyx_t_15 = -1;
23047 6 : if (__pyx_t_24 < 0) {
23048 : __pyx_t_24 += __pyx_pybuffernd_temp_degrees.diminfo[0].shape;
23049 : if (unlikely(__pyx_t_24 < 0)) __pyx_t_15 = 0;
23050 6 : } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_temp_degrees.diminfo[0].shape)) __pyx_t_15 = 0;
23051 6 : if (unlikely(__pyx_t_15 != -1)) {
23052 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
23053 0 : __PYX_ERR(0, 151, __pyx_L1_error)
23054 : }
23055 6 : *__Pyx_BufPtrStrided1d(__pyx_t_5scipy_6sparse_7csgraph_11_reordering_ITYPE_t *, __pyx_pybuffernd_temp_degrees.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_temp_degrees.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_degree.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_degree.diminfo[0].strides));
23056 :
23057 : /* "scipy/sparse/csgraph/_reordering.pyx":152
23058 : * for kk in range(N_old, N):
23059 : * temp_degrees[level_len] = degree[order[kk]]
23060 : * level_len += 1 # <<<<<<<<<<<<<<
23061 : *
23062 : * # Do insertion sort for nodes from lowest to highest degree
23063 : */
23064 6 : __pyx_v_level_len = (__pyx_v_level_len + 1);
23065 : }
23066 :
23067 : /* "scipy/sparse/csgraph/_reordering.pyx":155
23068 : *
23069 : * # Do insertion sort for nodes from lowest to highest degree
23070 : * for kk in range(1,level_len): # <<<<<<<<<<<<<<
23071 : * temp = temp_degrees[kk]
23072 : * temp2 = order[N_old+kk]
23073 : */
23074 9 : __pyx_t_23 = __pyx_v_level_len;
23075 : __pyx_t_25 = __pyx_t_23;
23076 9 : for (__pyx_t_26 = 1; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
23077 1 : __pyx_v_kk = __pyx_t_26;
23078 :
23079 : /* "scipy/sparse/csgraph/_reordering.pyx":156
23080 : * # Do insertion sort for nodes from lowest to highest degree
23081 : * for kk in range(1,level_len):
23082 : * temp = temp_degrees[kk] # <<<<<<<<<<<<<<
23083 : * temp2 = order[N_old+kk]
23084 : * ll = kk
23085 : */
23086 1 : __pyx_t_14 = __pyx_v_kk;
23087 1 : __pyx_t_15 = -1;
23088 1 : if (__pyx_t_14 < 0) {
23089 : __pyx_t_14 += __pyx_pybuffernd_temp_degrees.diminfo[0].shape;
23090 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
23091 1 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_temp_degrees.diminfo[0].shape)) __pyx_t_15 = 0;
23092 1 : if (unlikely(__pyx_t_15 != -1)) {
23093 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
23094 0 : __PYX_ERR(0, 156, __pyx_L1_error)
23095 : }
23096 1 : __pyx_v_temp = (*__Pyx_BufPtrStrided1d(__pyx_t_5scipy_6sparse_7csgraph_11_reordering_ITYPE_t *, __pyx_pybuffernd_temp_degrees.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_temp_degrees.diminfo[0].strides));
23097 :
23098 : /* "scipy/sparse/csgraph/_reordering.pyx":157
23099 : * for kk in range(1,level_len):
23100 : * temp = temp_degrees[kk]
23101 : * temp2 = order[N_old+kk] # <<<<<<<<<<<<<<
23102 : * ll = kk
23103 : * while (ll > 0) and (temp < temp_degrees[ll-1]):
23104 : */
23105 1 : __pyx_t_14 = (__pyx_v_N_old + __pyx_v_kk);
23106 1 : __pyx_t_15 = -1;
23107 1 : if (__pyx_t_14 < 0) {
23108 0 : __pyx_t_14 += __pyx_pybuffernd_order.diminfo[0].shape;
23109 0 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
23110 1 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_order.diminfo[0].shape)) __pyx_t_15 = 0;
23111 1 : if (unlikely(__pyx_t_15 != -1)) {
23112 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
23113 0 : __PYX_ERR(0, 157, __pyx_L1_error)
23114 : }
23115 1 : __pyx_v_temp2 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_order.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_order.diminfo[0].strides));
23116 :
23117 : /* "scipy/sparse/csgraph/_reordering.pyx":158
23118 : * temp = temp_degrees[kk]
23119 : * temp2 = order[N_old+kk]
23120 : * ll = kk # <<<<<<<<<<<<<<
23121 : * while (ll > 0) and (temp < temp_degrees[ll-1]):
23122 : * temp_degrees[ll] = temp_degrees[ll-1]
23123 : */
23124 1 : __pyx_v_ll = __pyx_v_kk;
23125 :
23126 : /* "scipy/sparse/csgraph/_reordering.pyx":159
23127 : * temp2 = order[N_old+kk]
23128 : * ll = kk
23129 : * while (ll > 0) and (temp < temp_degrees[ll-1]): # <<<<<<<<<<<<<<
23130 : * temp_degrees[ll] = temp_degrees[ll-1]
23131 : * order[N_old+ll] = order[N_old+ll-1]
23132 : */
23133 1 : while (1) {
23134 1 : __pyx_t_27 = (__pyx_v_ll > 0);
23135 1 : if (__pyx_t_27) {
23136 1 : } else {
23137 0 : __pyx_t_16 = __pyx_t_27;
23138 0 : goto __pyx_L19_bool_binop_done;
23139 : }
23140 1 : __pyx_t_14 = (__pyx_v_ll - 1);
23141 1 : __pyx_t_15 = -1;
23142 1 : if (__pyx_t_14 < 0) {
23143 : __pyx_t_14 += __pyx_pybuffernd_temp_degrees.diminfo[0].shape;
23144 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
23145 1 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_temp_degrees.diminfo[0].shape)) __pyx_t_15 = 0;
23146 1 : if (unlikely(__pyx_t_15 != -1)) {
23147 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
23148 0 : __PYX_ERR(0, 159, __pyx_L1_error)
23149 : }
23150 1 : __pyx_t_27 = (__pyx_v_temp < (*__Pyx_BufPtrStrided1d(__pyx_t_5scipy_6sparse_7csgraph_11_reordering_ITYPE_t *, __pyx_pybuffernd_temp_degrees.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_temp_degrees.diminfo[0].strides)));
23151 1 : __pyx_t_16 = __pyx_t_27;
23152 1 : __pyx_L19_bool_binop_done:;
23153 1 : if (!__pyx_t_16) break;
23154 :
23155 : /* "scipy/sparse/csgraph/_reordering.pyx":160
23156 : * ll = kk
23157 : * while (ll > 0) and (temp < temp_degrees[ll-1]):
23158 : * temp_degrees[ll] = temp_degrees[ll-1] # <<<<<<<<<<<<<<
23159 : * order[N_old+ll] = order[N_old+ll-1]
23160 : * ll -= 1
23161 : */
23162 0 : __pyx_t_14 = (__pyx_v_ll - 1);
23163 0 : __pyx_t_15 = -1;
23164 0 : if (__pyx_t_14 < 0) {
23165 0 : __pyx_t_14 += __pyx_pybuffernd_temp_degrees.diminfo[0].shape;
23166 0 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
23167 0 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_temp_degrees.diminfo[0].shape)) __pyx_t_15 = 0;
23168 0 : if (unlikely(__pyx_t_15 != -1)) {
23169 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
23170 0 : __PYX_ERR(0, 160, __pyx_L1_error)
23171 : }
23172 0 : __pyx_t_17 = __pyx_v_ll;
23173 0 : __pyx_t_15 = -1;
23174 0 : if (__pyx_t_17 < 0) {
23175 0 : __pyx_t_17 += __pyx_pybuffernd_temp_degrees.diminfo[0].shape;
23176 0 : if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 0;
23177 0 : } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_temp_degrees.diminfo[0].shape)) __pyx_t_15 = 0;
23178 0 : if (unlikely(__pyx_t_15 != -1)) {
23179 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
23180 0 : __PYX_ERR(0, 160, __pyx_L1_error)
23181 : }
23182 0 : *__Pyx_BufPtrStrided1d(__pyx_t_5scipy_6sparse_7csgraph_11_reordering_ITYPE_t *, __pyx_pybuffernd_temp_degrees.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_temp_degrees.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5scipy_6sparse_7csgraph_11_reordering_ITYPE_t *, __pyx_pybuffernd_temp_degrees.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_temp_degrees.diminfo[0].strides));
23183 :
23184 : /* "scipy/sparse/csgraph/_reordering.pyx":161
23185 : * while (ll > 0) and (temp < temp_degrees[ll-1]):
23186 : * temp_degrees[ll] = temp_degrees[ll-1]
23187 : * order[N_old+ll] = order[N_old+ll-1] # <<<<<<<<<<<<<<
23188 : * ll -= 1
23189 : * temp_degrees[ll] = temp
23190 : */
23191 0 : __pyx_t_14 = ((__pyx_v_N_old + __pyx_v_ll) - 1);
23192 0 : __pyx_t_15 = -1;
23193 0 : if (__pyx_t_14 < 0) {
23194 0 : __pyx_t_14 += __pyx_pybuffernd_order.diminfo[0].shape;
23195 0 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
23196 0 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_order.diminfo[0].shape)) __pyx_t_15 = 0;
23197 0 : if (unlikely(__pyx_t_15 != -1)) {
23198 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
23199 0 : __PYX_ERR(0, 161, __pyx_L1_error)
23200 : }
23201 0 : __pyx_t_17 = (__pyx_v_N_old + __pyx_v_ll);
23202 0 : __pyx_t_15 = -1;
23203 0 : if (__pyx_t_17 < 0) {
23204 0 : __pyx_t_17 += __pyx_pybuffernd_order.diminfo[0].shape;
23205 0 : if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 0;
23206 0 : } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_order.diminfo[0].shape)) __pyx_t_15 = 0;
23207 0 : if (unlikely(__pyx_t_15 != -1)) {
23208 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
23209 0 : __PYX_ERR(0, 161, __pyx_L1_error)
23210 : }
23211 0 : *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_order.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_order.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_order.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_order.diminfo[0].strides));
23212 :
23213 : /* "scipy/sparse/csgraph/_reordering.pyx":162
23214 : * temp_degrees[ll] = temp_degrees[ll-1]
23215 : * order[N_old+ll] = order[N_old+ll-1]
23216 : * ll -= 1 # <<<<<<<<<<<<<<
23217 : * temp_degrees[ll] = temp
23218 : * order[N_old+ll] = temp2
23219 : */
23220 0 : __pyx_v_ll = (__pyx_v_ll - 1);
23221 : }
23222 :
23223 : /* "scipy/sparse/csgraph/_reordering.pyx":163
23224 : * order[N_old+ll] = order[N_old+ll-1]
23225 : * ll -= 1
23226 : * temp_degrees[ll] = temp # <<<<<<<<<<<<<<
23227 : * order[N_old+ll] = temp2
23228 : *
23229 : */
23230 1 : __pyx_t_14 = __pyx_v_ll;
23231 1 : __pyx_t_15 = -1;
23232 1 : if (__pyx_t_14 < 0) {
23233 0 : __pyx_t_14 += __pyx_pybuffernd_temp_degrees.diminfo[0].shape;
23234 0 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
23235 1 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_temp_degrees.diminfo[0].shape)) __pyx_t_15 = 0;
23236 1 : if (unlikely(__pyx_t_15 != -1)) {
23237 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
23238 0 : __PYX_ERR(0, 163, __pyx_L1_error)
23239 : }
23240 1 : *__Pyx_BufPtrStrided1d(__pyx_t_5scipy_6sparse_7csgraph_11_reordering_ITYPE_t *, __pyx_pybuffernd_temp_degrees.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_temp_degrees.diminfo[0].strides) = __pyx_v_temp;
23241 :
23242 : /* "scipy/sparse/csgraph/_reordering.pyx":164
23243 : * ll -= 1
23244 : * temp_degrees[ll] = temp
23245 : * order[N_old+ll] = temp2 # <<<<<<<<<<<<<<
23246 : *
23247 : * # set next level start and end ranges
23248 : */
23249 1 : __pyx_t_14 = (__pyx_v_N_old + __pyx_v_ll);
23250 1 : __pyx_t_15 = -1;
23251 1 : if (__pyx_t_14 < 0) {
23252 0 : __pyx_t_14 += __pyx_pybuffernd_order.diminfo[0].shape;
23253 0 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
23254 1 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_order.diminfo[0].shape)) __pyx_t_15 = 0;
23255 1 : if (unlikely(__pyx_t_15 != -1)) {
23256 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
23257 0 : __PYX_ERR(0, 164, __pyx_L1_error)
23258 : }
23259 1 : *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_order.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_order.diminfo[0].strides) = __pyx_v_temp2;
23260 : }
23261 : }
23262 :
23263 : /* "scipy/sparse/csgraph/_reordering.pyx":167
23264 : *
23265 : * # set next level start and end ranges
23266 : * level_start = level_end # <<<<<<<<<<<<<<
23267 : * level_end = N
23268 : *
23269 : */
23270 : __pyx_v_level_start = __pyx_v_level_end;
23271 :
23272 : /* "scipy/sparse/csgraph/_reordering.pyx":168
23273 : * # set next level start and end ranges
23274 : * level_start = level_end
23275 : * level_end = N # <<<<<<<<<<<<<<
23276 : *
23277 : * if N == num_rows:
23278 : */
23279 : __pyx_v_level_end = __pyx_v_N;
23280 : }
23281 :
23282 : /* "scipy/sparse/csgraph/_reordering.pyx":126
23283 : * # loop over zz takes into account possible disconnected graph.
23284 : * for zz in range(num_rows):
23285 : * if inds[zz] != -1: # Do BFS with seed=inds[zz] # <<<<<<<<<<<<<<
23286 : * seed = inds[zz]
23287 : * order[N] = seed
23288 : */
23289 : }
23290 :
23291 : /* "scipy/sparse/csgraph/_reordering.pyx":170
23292 : * level_end = N
23293 : *
23294 : * if N == num_rows: # <<<<<<<<<<<<<<
23295 : * break
23296 : *
23297 : */
23298 2 : __pyx_t_16 = (__pyx_v_N == __pyx_v_num_rows);
23299 2 : if (__pyx_t_16) {
23300 :
23301 : /* "scipy/sparse/csgraph/_reordering.pyx":171
23302 : *
23303 : * if N == num_rows:
23304 : * break # <<<<<<<<<<<<<<
23305 : *
23306 : * # return reversed order for RCM ordering
23307 : */
23308 1 : goto __pyx_L4_break;
23309 :
23310 : /* "scipy/sparse/csgraph/_reordering.pyx":170
23311 : * level_end = N
23312 : *
23313 : * if N == num_rows: # <<<<<<<<<<<<<<
23314 : * break
23315 : *
23316 : */
23317 : }
23318 : }
23319 0 : __pyx_L4_break:;
23320 :
23321 : /* "scipy/sparse/csgraph/_reordering.pyx":174
23322 : *
23323 : * # return reversed order for RCM ordering
23324 : * return order[::-1] # <<<<<<<<<<<<<<
23325 : *
23326 : *
23327 : */
23328 1 : __Pyx_XDECREF(__pyx_r);
23329 1 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_order), __pyx_slice__17); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L1_error)
23330 1 : __Pyx_GOTREF(__pyx_t_3);
23331 1 : __pyx_r = __pyx_t_3;
23332 1 : __pyx_t_3 = 0;
23333 1 : goto __pyx_L0;
23334 :
23335 : /* "scipy/sparse/csgraph/_reordering.pyx":107
23336 : *
23337 : *
23338 : * def _reverse_cuthill_mckee(np.ndarray[int32_or_int64, ndim=1, mode="c"] ind, # <<<<<<<<<<<<<<
23339 : * np.ndarray[int32_or_int64, ndim=1, mode="c"] ptr,
23340 : * np.npy_intp num_rows):
23341 : */
23342 :
23343 : /* function exit code */
23344 0 : __pyx_L1_error:;
23345 0 : __Pyx_XDECREF(__pyx_t_1);
23346 0 : __Pyx_XDECREF(__pyx_t_2);
23347 0 : __Pyx_XDECREF(__pyx_t_3);
23348 0 : __Pyx_XDECREF(__pyx_t_4);
23349 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
23350 0 : __Pyx_PyThreadState_declare
23351 0 : __Pyx_PyThreadState_assign
23352 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
23353 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_degree.rcbuffer->pybuffer);
23354 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ind.rcbuffer->pybuffer);
23355 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer);
23356 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_order.rcbuffer->pybuffer);
23357 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ptr.rcbuffer->pybuffer);
23358 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rev_inds.rcbuffer->pybuffer);
23359 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_temp_degrees.rcbuffer->pybuffer);
23360 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
23361 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._reordering._reverse_cuthill_mckee", __pyx_clineno, __pyx_lineno, __pyx_filename);
23362 0 : __pyx_r = NULL;
23363 0 : goto __pyx_L2;
23364 1 : __pyx_L0:;
23365 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_degree.rcbuffer->pybuffer);
23366 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ind.rcbuffer->pybuffer);
23367 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer);
23368 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_order.rcbuffer->pybuffer);
23369 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ptr.rcbuffer->pybuffer);
23370 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rev_inds.rcbuffer->pybuffer);
23371 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_temp_degrees.rcbuffer->pybuffer);
23372 1 : __pyx_L2:;
23373 1 : __Pyx_XDECREF((PyObject *)__pyx_v_order);
23374 1 : __Pyx_XDECREF((PyObject *)__pyx_v_degree);
23375 1 : __Pyx_XDECREF((PyObject *)__pyx_v_inds);
23376 1 : __Pyx_XDECREF((PyObject *)__pyx_v_rev_inds);
23377 1 : __Pyx_XDECREF((PyObject *)__pyx_v_temp_degrees);
23378 1 : __Pyx_XGIVEREF(__pyx_r);
23379 1 : __Pyx_RefNannyFinishContext();
23380 1 : return __pyx_r;
23381 : }
23382 :
23383 : /* Python wrapper */
23384 : static PyObject *__pyx_fuse_1__pyx_pw_5scipy_6sparse_7csgraph_11_reordering_9_reverse_cuthill_mckee(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
23385 : static PyMethodDef __pyx_fuse_1__pyx_mdef_5scipy_6sparse_7csgraph_11_reordering_9_reverse_cuthill_mckee = {"__pyx_fuse_1_reverse_cuthill_mckee", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_fuse_1__pyx_pw_5scipy_6sparse_7csgraph_11_reordering_9_reverse_cuthill_mckee, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5scipy_6sparse_7csgraph_11_reordering_2_reverse_cuthill_mckee};
23386 2 : static PyObject *__pyx_fuse_1__pyx_pw_5scipy_6sparse_7csgraph_11_reordering_9_reverse_cuthill_mckee(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
23387 2 : PyArrayObject *__pyx_v_ind = 0;
23388 2 : PyArrayObject *__pyx_v_ptr = 0;
23389 2 : npy_intp __pyx_v_num_rows;
23390 2 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
23391 2 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
23392 2 : PyObject* values[3] = {0,0,0};
23393 2 : int __pyx_lineno = 0;
23394 2 : const char *__pyx_filename = NULL;
23395 2 : int __pyx_clineno = 0;
23396 2 : PyObject *__pyx_r = 0;
23397 : __Pyx_RefNannyDeclarations
23398 2 : __Pyx_RefNannySetupContext("_reverse_cuthill_mckee (wrapper)", 0);
23399 : #if CYTHON_ASSUME_SAFE_MACROS
23400 2 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
23401 : #else
23402 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
23403 : #endif
23404 2 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
23405 : {
23406 2 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ind,&__pyx_n_s_ptr,&__pyx_n_s_num_rows,0};
23407 2 : if (__pyx_kwds) {
23408 0 : Py_ssize_t kw_args;
23409 0 : switch (__pyx_nargs) {
23410 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
23411 0 : CYTHON_FALLTHROUGH;
23412 0 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
23413 0 : CYTHON_FALLTHROUGH;
23414 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
23415 0 : CYTHON_FALLTHROUGH;
23416 0 : case 0: break;
23417 0 : default: goto __pyx_L5_argtuple_error;
23418 : }
23419 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
23420 0 : switch (__pyx_nargs) {
23421 0 : case 0:
23422 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ind)) != 0)) {
23423 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
23424 0 : kw_args--;
23425 : }
23426 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L3_error)
23427 0 : else goto __pyx_L5_argtuple_error;
23428 0 : CYTHON_FALLTHROUGH;
23429 : case 1:
23430 0 : if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ptr)) != 0)) {
23431 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
23432 0 : kw_args--;
23433 : }
23434 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L3_error)
23435 : else {
23436 0 : __Pyx_RaiseArgtupleInvalid("_reverse_cuthill_mckee", 1, 3, 3, 1); __PYX_ERR(0, 107, __pyx_L3_error)
23437 : }
23438 0 : CYTHON_FALLTHROUGH;
23439 : case 2:
23440 0 : if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_num_rows)) != 0)) {
23441 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[2]);
23442 0 : kw_args--;
23443 : }
23444 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L3_error)
23445 : else {
23446 0 : __Pyx_RaiseArgtupleInvalid("_reverse_cuthill_mckee", 1, 3, 3, 2); __PYX_ERR(0, 107, __pyx_L3_error)
23447 : }
23448 : }
23449 0 : if (unlikely(kw_args > 0)) {
23450 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
23451 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_reverse_cuthill_mckee") < 0)) __PYX_ERR(0, 107, __pyx_L3_error)
23452 : }
23453 2 : } else if (unlikely(__pyx_nargs != 3)) {
23454 0 : goto __pyx_L5_argtuple_error;
23455 : } else {
23456 2 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
23457 2 : values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
23458 2 : values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
23459 : }
23460 2 : __pyx_v_ind = ((PyArrayObject *)values[0]);
23461 2 : __pyx_v_ptr = ((PyArrayObject *)values[1]);
23462 2 : __pyx_v_num_rows = __Pyx_PyInt_As_npy_intp(values[2]); if (unlikely((__pyx_v_num_rows == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 109, __pyx_L3_error)
23463 : }
23464 2 : goto __pyx_L6_skip;
23465 0 : __pyx_L5_argtuple_error:;
23466 0 : __Pyx_RaiseArgtupleInvalid("_reverse_cuthill_mckee", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 107, __pyx_L3_error)
23467 2 : __pyx_L6_skip:;
23468 2 : goto __pyx_L4_argument_unpacking_done;
23469 0 : __pyx_L3_error:;
23470 : {
23471 0 : Py_ssize_t __pyx_temp;
23472 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23473 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
23474 : }
23475 : }
23476 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._reordering._reverse_cuthill_mckee", __pyx_clineno, __pyx_lineno, __pyx_filename);
23477 0 : __Pyx_RefNannyFinishContext();
23478 0 : return NULL;
23479 2 : __pyx_L4_argument_unpacking_done:;
23480 2 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ind), __pyx_ptype_5numpy_ndarray, 1, "ind", 0))) __PYX_ERR(0, 107, __pyx_L1_error)
23481 2 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ptr), __pyx_ptype_5numpy_ndarray, 1, "ptr", 0))) __PYX_ERR(0, 108, __pyx_L1_error)
23482 2 : __pyx_r = __pyx_pf_5scipy_6sparse_7csgraph_11_reordering_8_reverse_cuthill_mckee(__pyx_self, __pyx_v_ind, __pyx_v_ptr, __pyx_v_num_rows);
23483 :
23484 : /* function exit code */
23485 2 : goto __pyx_L0;
23486 : __pyx_L1_error:;
23487 : __pyx_r = NULL;
23488 2 : __pyx_L0:;
23489 : {
23490 2 : Py_ssize_t __pyx_temp;
23491 2 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23492 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
23493 : }
23494 : }
23495 : __Pyx_RefNannyFinishContext();
23496 : return __pyx_r;
23497 : }
23498 :
23499 2 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_11_reordering_8_reverse_cuthill_mckee(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_ind, PyArrayObject *__pyx_v_ptr, npy_intp __pyx_v_num_rows) {
23500 2 : npy_intp __pyx_v_N;
23501 2 : npy_intp __pyx_v_N_old;
23502 2 : npy_intp __pyx_v_level_start;
23503 2 : npy_intp __pyx_v_level_end;
23504 2 : npy_intp __pyx_v_temp;
23505 2 : npy_intp __pyx_v_zz;
23506 2 : npy_intp __pyx_v_ii;
23507 2 : npy_intp __pyx_v_jj;
23508 2 : npy_intp __pyx_v_kk;
23509 2 : npy_intp __pyx_v_ll;
23510 2 : npy_intp __pyx_v_level_len;
23511 2 : PyArrayObject *__pyx_v_order = 0;
23512 2 : PyArrayObject *__pyx_v_degree = 0;
23513 2 : PyArrayObject *__pyx_v_inds = 0;
23514 2 : PyArrayObject *__pyx_v_rev_inds = 0;
23515 2 : PyArrayObject *__pyx_v_temp_degrees = 0;
23516 2 : __pyx_t_5numpy_int64_t __pyx_v_i;
23517 2 : __pyx_t_5numpy_int64_t __pyx_v_j;
23518 2 : __pyx_t_5numpy_int64_t __pyx_v_seed;
23519 2 : __pyx_t_5numpy_int64_t __pyx_v_temp2;
23520 2 : __Pyx_LocalBuf_ND __pyx_pybuffernd_degree;
23521 2 : __Pyx_Buffer __pyx_pybuffer_degree;
23522 2 : __Pyx_LocalBuf_ND __pyx_pybuffernd_ind;
23523 2 : __Pyx_Buffer __pyx_pybuffer_ind;
23524 2 : __Pyx_LocalBuf_ND __pyx_pybuffernd_inds;
23525 2 : __Pyx_Buffer __pyx_pybuffer_inds;
23526 2 : __Pyx_LocalBuf_ND __pyx_pybuffernd_order;
23527 2 : __Pyx_Buffer __pyx_pybuffer_order;
23528 2 : __Pyx_LocalBuf_ND __pyx_pybuffernd_ptr;
23529 2 : __Pyx_Buffer __pyx_pybuffer_ptr;
23530 2 : __Pyx_LocalBuf_ND __pyx_pybuffernd_rev_inds;
23531 2 : __Pyx_Buffer __pyx_pybuffer_rev_inds;
23532 2 : __Pyx_LocalBuf_ND __pyx_pybuffernd_temp_degrees;
23533 2 : __Pyx_Buffer __pyx_pybuffer_temp_degrees;
23534 2 : PyObject *__pyx_r = NULL;
23535 : __Pyx_RefNannyDeclarations
23536 2 : PyObject *__pyx_t_1 = NULL;
23537 2 : PyObject *__pyx_t_2 = NULL;
23538 2 : PyObject *__pyx_t_3 = NULL;
23539 2 : PyObject *__pyx_t_4 = NULL;
23540 2 : PyArrayObject *__pyx_t_5 = NULL;
23541 2 : PyArrayObject *__pyx_t_6 = NULL;
23542 2 : unsigned int __pyx_t_7;
23543 2 : PyArrayObject *__pyx_t_8 = NULL;
23544 2 : PyArrayObject *__pyx_t_9 = NULL;
23545 2 : PyArrayObject *__pyx_t_10 = NULL;
23546 2 : npy_intp __pyx_t_11;
23547 2 : npy_intp __pyx_t_12;
23548 2 : npy_intp __pyx_t_13;
23549 2 : Py_ssize_t __pyx_t_14;
23550 2 : int __pyx_t_15;
23551 2 : int __pyx_t_16;
23552 2 : __pyx_t_5numpy_int64_t __pyx_t_17;
23553 2 : npy_intp __pyx_t_18;
23554 2 : npy_intp __pyx_t_19;
23555 2 : npy_intp __pyx_t_20;
23556 2 : __pyx_t_5numpy_int64_t __pyx_t_21;
23557 2 : __pyx_t_5numpy_int64_t __pyx_t_22;
23558 2 : npy_intp __pyx_t_23;
23559 2 : __pyx_t_5numpy_int64_t __pyx_t_24;
23560 2 : npy_intp __pyx_t_25;
23561 2 : npy_intp __pyx_t_26;
23562 2 : Py_ssize_t __pyx_t_27;
23563 2 : int __pyx_t_28;
23564 2 : int __pyx_lineno = 0;
23565 2 : const char *__pyx_filename = NULL;
23566 2 : int __pyx_clineno = 0;
23567 2 : __Pyx_RefNannySetupContext("__pyx_fuse_1_reverse_cuthill_mckee", 1);
23568 2 : __pyx_pybuffer_order.pybuffer.buf = NULL;
23569 2 : __pyx_pybuffer_order.refcount = 0;
23570 2 : __pyx_pybuffernd_order.data = NULL;
23571 2 : __pyx_pybuffernd_order.rcbuffer = &__pyx_pybuffer_order;
23572 2 : __pyx_pybuffer_degree.pybuffer.buf = NULL;
23573 2 : __pyx_pybuffer_degree.refcount = 0;
23574 2 : __pyx_pybuffernd_degree.data = NULL;
23575 2 : __pyx_pybuffernd_degree.rcbuffer = &__pyx_pybuffer_degree;
23576 2 : __pyx_pybuffer_inds.pybuffer.buf = NULL;
23577 2 : __pyx_pybuffer_inds.refcount = 0;
23578 2 : __pyx_pybuffernd_inds.data = NULL;
23579 2 : __pyx_pybuffernd_inds.rcbuffer = &__pyx_pybuffer_inds;
23580 2 : __pyx_pybuffer_rev_inds.pybuffer.buf = NULL;
23581 2 : __pyx_pybuffer_rev_inds.refcount = 0;
23582 2 : __pyx_pybuffernd_rev_inds.data = NULL;
23583 2 : __pyx_pybuffernd_rev_inds.rcbuffer = &__pyx_pybuffer_rev_inds;
23584 2 : __pyx_pybuffer_temp_degrees.pybuffer.buf = NULL;
23585 2 : __pyx_pybuffer_temp_degrees.refcount = 0;
23586 2 : __pyx_pybuffernd_temp_degrees.data = NULL;
23587 2 : __pyx_pybuffernd_temp_degrees.rcbuffer = &__pyx_pybuffer_temp_degrees;
23588 2 : __pyx_pybuffer_ind.pybuffer.buf = NULL;
23589 2 : __pyx_pybuffer_ind.refcount = 0;
23590 2 : __pyx_pybuffernd_ind.data = NULL;
23591 2 : __pyx_pybuffernd_ind.rcbuffer = &__pyx_pybuffer_ind;
23592 2 : __pyx_pybuffer_ptr.pybuffer.buf = NULL;
23593 2 : __pyx_pybuffer_ptr.refcount = 0;
23594 2 : __pyx_pybuffernd_ptr.data = NULL;
23595 2 : __pyx_pybuffernd_ptr.rcbuffer = &__pyx_pybuffer_ptr;
23596 : {
23597 2 : __Pyx_BufFmt_StackElem __pyx_stack[1];
23598 2 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ind.rcbuffer->pybuffer, (PyObject*)__pyx_v_ind, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 107, __pyx_L1_error)
23599 : }
23600 2 : __pyx_pybuffernd_ind.diminfo[0].strides = __pyx_pybuffernd_ind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ind.diminfo[0].shape = __pyx_pybuffernd_ind.rcbuffer->pybuffer.shape[0];
23601 : {
23602 2 : __Pyx_BufFmt_StackElem __pyx_stack[1];
23603 2 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_ptr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 107, __pyx_L1_error)
23604 : }
23605 2 : __pyx_pybuffernd_ptr.diminfo[0].strides = __pyx_pybuffernd_ptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptr.diminfo[0].shape = __pyx_pybuffernd_ptr.rcbuffer->pybuffer.shape[0];
23606 :
23607 : /* "scipy/sparse/csgraph/_reordering.pyx":115
23608 : * at a node of lowest degree for each connected component.
23609 : * """
23610 : * cdef np.npy_intp N = 0, N_old, level_start, level_end, temp # <<<<<<<<<<<<<<
23611 : * cdef np.npy_intp zz, ii, jj, kk, ll, level_len
23612 : * cdef np.ndarray[int32_or_int64] order = np.zeros(num_rows, dtype=ind.dtype)
23613 : */
23614 2 : __pyx_v_N = 0;
23615 :
23616 : /* "scipy/sparse/csgraph/_reordering.pyx":117
23617 : * cdef np.npy_intp N = 0, N_old, level_start, level_end, temp
23618 : * cdef np.npy_intp zz, ii, jj, kk, ll, level_len
23619 : * cdef np.ndarray[int32_or_int64] order = np.zeros(num_rows, dtype=ind.dtype) # <<<<<<<<<<<<<<
23620 : * cdef np.ndarray[int32_or_int64] degree = _node_degrees(ind, ptr, num_rows)
23621 : * cdef np.ndarray[np.npy_intp] inds = np.argsort(degree)
23622 : */
23623 2 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
23624 2 : __Pyx_GOTREF(__pyx_t_1);
23625 2 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
23626 2 : __Pyx_GOTREF(__pyx_t_2);
23627 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23628 2 : __pyx_t_1 = __Pyx_PyInt_From_npy_intp(__pyx_v_num_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
23629 2 : __Pyx_GOTREF(__pyx_t_1);
23630 2 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error)
23631 2 : __Pyx_GOTREF(__pyx_t_3);
23632 2 : __Pyx_GIVEREF(__pyx_t_1);
23633 2 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error);
23634 2 : __pyx_t_1 = 0;
23635 2 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
23636 2 : __Pyx_GOTREF(__pyx_t_1);
23637 2 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ind), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L1_error)
23638 2 : __Pyx_GOTREF(__pyx_t_4);
23639 2 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 117, __pyx_L1_error)
23640 2 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23641 2 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L1_error)
23642 2 : __Pyx_GOTREF(__pyx_t_4);
23643 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23644 2 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23645 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23646 2 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 117, __pyx_L1_error)
23647 2 : __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
23648 : {
23649 2 : __Pyx_BufFmt_StackElem __pyx_stack[1];
23650 2 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_order.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
23651 0 : __pyx_v_order = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_order.rcbuffer->pybuffer.buf = NULL;
23652 0 : __PYX_ERR(0, 117, __pyx_L1_error)
23653 2 : } else {__pyx_pybuffernd_order.diminfo[0].strides = __pyx_pybuffernd_order.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_order.diminfo[0].shape = __pyx_pybuffernd_order.rcbuffer->pybuffer.shape[0];
23654 : }
23655 : }
23656 2 : __pyx_t_5 = 0;
23657 2 : __pyx_v_order = ((PyArrayObject *)__pyx_t_4);
23658 2 : __pyx_t_4 = 0;
23659 :
23660 : /* "scipy/sparse/csgraph/_reordering.pyx":118
23661 : * cdef np.npy_intp zz, ii, jj, kk, ll, level_len
23662 : * cdef np.ndarray[int32_or_int64] order = np.zeros(num_rows, dtype=ind.dtype)
23663 : * cdef np.ndarray[int32_or_int64] degree = _node_degrees(ind, ptr, num_rows) # <<<<<<<<<<<<<<
23664 : * cdef np.ndarray[np.npy_intp] inds = np.argsort(degree)
23665 : * cdef np.ndarray[np.npy_intp] rev_inds = np.argsort(inds)
23666 : */
23667 2 : __pyx_t_4 = __pyx_fuse_1__pyx_f_5scipy_6sparse_7csgraph_11_reordering__node_degrees(((PyArrayObject *)__pyx_v_ind), ((PyArrayObject *)__pyx_v_ptr), __pyx_v_num_rows); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L1_error)
23668 2 : __Pyx_GOTREF(__pyx_t_4);
23669 2 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 118, __pyx_L1_error)
23670 2 : __pyx_t_6 = ((PyArrayObject *)__pyx_t_4);
23671 : {
23672 2 : __Pyx_BufFmt_StackElem __pyx_stack[1];
23673 2 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_degree.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
23674 0 : __pyx_v_degree = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_degree.rcbuffer->pybuffer.buf = NULL;
23675 0 : __PYX_ERR(0, 118, __pyx_L1_error)
23676 2 : } else {__pyx_pybuffernd_degree.diminfo[0].strides = __pyx_pybuffernd_degree.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_degree.diminfo[0].shape = __pyx_pybuffernd_degree.rcbuffer->pybuffer.shape[0];
23677 : }
23678 : }
23679 2 : __pyx_t_6 = 0;
23680 2 : __pyx_v_degree = ((PyArrayObject *)__pyx_t_4);
23681 2 : __pyx_t_4 = 0;
23682 :
23683 : /* "scipy/sparse/csgraph/_reordering.pyx":119
23684 : * cdef np.ndarray[int32_or_int64] order = np.zeros(num_rows, dtype=ind.dtype)
23685 : * cdef np.ndarray[int32_or_int64] degree = _node_degrees(ind, ptr, num_rows)
23686 : * cdef np.ndarray[np.npy_intp] inds = np.argsort(degree) # <<<<<<<<<<<<<<
23687 : * cdef np.ndarray[np.npy_intp] rev_inds = np.argsort(inds)
23688 : * cdef np.ndarray[ITYPE_t] temp_degrees = np.zeros(np.max(degree), dtype=ITYPE)
23689 : */
23690 2 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
23691 2 : __Pyx_GOTREF(__pyx_t_1);
23692 2 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_argsort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error)
23693 2 : __Pyx_GOTREF(__pyx_t_3);
23694 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23695 2 : __pyx_t_1 = NULL;
23696 2 : __pyx_t_7 = 0;
23697 : #if CYTHON_UNPACK_METHODS
23698 2 : if (unlikely(PyMethod_Check(__pyx_t_3))) {
23699 0 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
23700 0 : if (likely(__pyx_t_1)) {
23701 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
23702 0 : __Pyx_INCREF(__pyx_t_1);
23703 0 : __Pyx_INCREF(function);
23704 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
23705 : __pyx_t_7 = 1;
23706 : }
23707 : }
23708 : #endif
23709 : {
23710 2 : PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_degree)};
23711 2 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
23712 2 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
23713 2 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error)
23714 2 : __Pyx_GOTREF(__pyx_t_4);
23715 2 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23716 : }
23717 2 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 119, __pyx_L1_error)
23718 2 : __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
23719 : {
23720 2 : __Pyx_BufFmt_StackElem __pyx_stack[1];
23721 2 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn_npy_intp, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
23722 0 : __pyx_v_inds = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_inds.rcbuffer->pybuffer.buf = NULL;
23723 0 : __PYX_ERR(0, 119, __pyx_L1_error)
23724 2 : } else {__pyx_pybuffernd_inds.diminfo[0].strides = __pyx_pybuffernd_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds.diminfo[0].shape = __pyx_pybuffernd_inds.rcbuffer->pybuffer.shape[0];
23725 : }
23726 : }
23727 2 : __pyx_t_8 = 0;
23728 2 : __pyx_v_inds = ((PyArrayObject *)__pyx_t_4);
23729 2 : __pyx_t_4 = 0;
23730 :
23731 : /* "scipy/sparse/csgraph/_reordering.pyx":120
23732 : * cdef np.ndarray[int32_or_int64] degree = _node_degrees(ind, ptr, num_rows)
23733 : * cdef np.ndarray[np.npy_intp] inds = np.argsort(degree)
23734 : * cdef np.ndarray[np.npy_intp] rev_inds = np.argsort(inds) # <<<<<<<<<<<<<<
23735 : * cdef np.ndarray[ITYPE_t] temp_degrees = np.zeros(np.max(degree), dtype=ITYPE)
23736 : * cdef int32_or_int64 i, j, seed, temp2
23737 : */
23738 2 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error)
23739 2 : __Pyx_GOTREF(__pyx_t_3);
23740 2 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
23741 2 : __Pyx_GOTREF(__pyx_t_1);
23742 2 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23743 2 : __pyx_t_3 = NULL;
23744 2 : __pyx_t_7 = 0;
23745 : #if CYTHON_UNPACK_METHODS
23746 2 : if (unlikely(PyMethod_Check(__pyx_t_1))) {
23747 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
23748 0 : if (likely(__pyx_t_3)) {
23749 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
23750 0 : __Pyx_INCREF(__pyx_t_3);
23751 0 : __Pyx_INCREF(function);
23752 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
23753 : __pyx_t_7 = 1;
23754 : }
23755 : }
23756 : #endif
23757 : {
23758 2 : PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_inds)};
23759 2 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
23760 2 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
23761 2 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 120, __pyx_L1_error)
23762 2 : __Pyx_GOTREF(__pyx_t_4);
23763 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23764 : }
23765 2 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 120, __pyx_L1_error)
23766 2 : __pyx_t_9 = ((PyArrayObject *)__pyx_t_4);
23767 : {
23768 2 : __Pyx_BufFmt_StackElem __pyx_stack[1];
23769 2 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rev_inds.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_npy_intp, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
23770 0 : __pyx_v_rev_inds = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_rev_inds.rcbuffer->pybuffer.buf = NULL;
23771 0 : __PYX_ERR(0, 120, __pyx_L1_error)
23772 2 : } else {__pyx_pybuffernd_rev_inds.diminfo[0].strides = __pyx_pybuffernd_rev_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rev_inds.diminfo[0].shape = __pyx_pybuffernd_rev_inds.rcbuffer->pybuffer.shape[0];
23773 : }
23774 : }
23775 2 : __pyx_t_9 = 0;
23776 2 : __pyx_v_rev_inds = ((PyArrayObject *)__pyx_t_4);
23777 2 : __pyx_t_4 = 0;
23778 :
23779 : /* "scipy/sparse/csgraph/_reordering.pyx":121
23780 : * cdef np.ndarray[np.npy_intp] inds = np.argsort(degree)
23781 : * cdef np.ndarray[np.npy_intp] rev_inds = np.argsort(inds)
23782 : * cdef np.ndarray[ITYPE_t] temp_degrees = np.zeros(np.max(degree), dtype=ITYPE) # <<<<<<<<<<<<<<
23783 : * cdef int32_or_int64 i, j, seed, temp2
23784 : *
23785 : */
23786 2 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error)
23787 2 : __Pyx_GOTREF(__pyx_t_4);
23788 2 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
23789 2 : __Pyx_GOTREF(__pyx_t_1);
23790 2 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23791 2 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
23792 2 : __Pyx_GOTREF(__pyx_t_3);
23793 2 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
23794 2 : __Pyx_GOTREF(__pyx_t_2);
23795 2 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23796 2 : __pyx_t_3 = NULL;
23797 2 : __pyx_t_7 = 0;
23798 : #if CYTHON_UNPACK_METHODS
23799 2 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
23800 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
23801 0 : if (likely(__pyx_t_3)) {
23802 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
23803 0 : __Pyx_INCREF(__pyx_t_3);
23804 0 : __Pyx_INCREF(function);
23805 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
23806 : __pyx_t_7 = 1;
23807 : }
23808 : }
23809 : #endif
23810 : {
23811 2 : PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_degree)};
23812 2 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
23813 2 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
23814 2 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error)
23815 2 : __Pyx_GOTREF(__pyx_t_4);
23816 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23817 : }
23818 2 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
23819 2 : __Pyx_GOTREF(__pyx_t_2);
23820 2 : __Pyx_GIVEREF(__pyx_t_4);
23821 2 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error);
23822 2 : __pyx_t_4 = 0;
23823 2 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error)
23824 2 : __Pyx_GOTREF(__pyx_t_4);
23825 2 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
23826 2 : __Pyx_GOTREF(__pyx_t_3);
23827 2 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 121, __pyx_L1_error)
23828 2 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23829 2 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
23830 2 : __Pyx_GOTREF(__pyx_t_3);
23831 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23832 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23833 2 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23834 2 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 121, __pyx_L1_error)
23835 2 : __pyx_t_10 = ((PyArrayObject *)__pyx_t_3);
23836 : {
23837 2 : __Pyx_BufFmt_StackElem __pyx_stack[1];
23838 2 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_temp_degrees.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5scipy_6sparse_7csgraph_11_reordering_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
23839 0 : __pyx_v_temp_degrees = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_temp_degrees.rcbuffer->pybuffer.buf = NULL;
23840 0 : __PYX_ERR(0, 121, __pyx_L1_error)
23841 2 : } else {__pyx_pybuffernd_temp_degrees.diminfo[0].strides = __pyx_pybuffernd_temp_degrees.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_temp_degrees.diminfo[0].shape = __pyx_pybuffernd_temp_degrees.rcbuffer->pybuffer.shape[0];
23842 : }
23843 : }
23844 2 : __pyx_t_10 = 0;
23845 2 : __pyx_v_temp_degrees = ((PyArrayObject *)__pyx_t_3);
23846 2 : __pyx_t_3 = 0;
23847 :
23848 : /* "scipy/sparse/csgraph/_reordering.pyx":125
23849 : *
23850 : * # loop over zz takes into account possible disconnected graph.
23851 : * for zz in range(num_rows): # <<<<<<<<<<<<<<
23852 : * if inds[zz] != -1: # Do BFS with seed=inds[zz]
23853 : * seed = inds[zz]
23854 : */
23855 2 : __pyx_t_11 = __pyx_v_num_rows;
23856 2 : __pyx_t_12 = __pyx_t_11;
23857 5 : for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
23858 5 : __pyx_v_zz = __pyx_t_13;
23859 :
23860 : /* "scipy/sparse/csgraph/_reordering.pyx":126
23861 : * # loop over zz takes into account possible disconnected graph.
23862 : * for zz in range(num_rows):
23863 : * if inds[zz] != -1: # Do BFS with seed=inds[zz] # <<<<<<<<<<<<<<
23864 : * seed = inds[zz]
23865 : * order[N] = seed
23866 : */
23867 5 : __pyx_t_14 = __pyx_v_zz;
23868 5 : __pyx_t_15 = -1;
23869 5 : if (__pyx_t_14 < 0) {
23870 : __pyx_t_14 += __pyx_pybuffernd_inds.diminfo[0].shape;
23871 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
23872 5 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_inds.diminfo[0].shape)) __pyx_t_15 = 0;
23873 5 : if (unlikely(__pyx_t_15 != -1)) {
23874 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
23875 0 : __PYX_ERR(0, 126, __pyx_L1_error)
23876 : }
23877 5 : __pyx_t_16 = ((*__Pyx_BufPtrStrided1d(npy_intp *, __pyx_pybuffernd_inds.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_inds.diminfo[0].strides)) != -1L);
23878 5 : if (__pyx_t_16) {
23879 :
23880 : /* "scipy/sparse/csgraph/_reordering.pyx":127
23881 : * for zz in range(num_rows):
23882 : * if inds[zz] != -1: # Do BFS with seed=inds[zz]
23883 : * seed = inds[zz] # <<<<<<<<<<<<<<
23884 : * order[N] = seed
23885 : * N += 1
23886 : */
23887 5 : __pyx_t_14 = __pyx_v_zz;
23888 5 : __pyx_t_15 = -1;
23889 5 : if (__pyx_t_14 < 0) {
23890 : __pyx_t_14 += __pyx_pybuffernd_inds.diminfo[0].shape;
23891 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
23892 5 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_inds.diminfo[0].shape)) __pyx_t_15 = 0;
23893 5 : if (unlikely(__pyx_t_15 != -1)) {
23894 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
23895 0 : __PYX_ERR(0, 127, __pyx_L1_error)
23896 : }
23897 5 : __pyx_v_seed = (*__Pyx_BufPtrStrided1d(npy_intp *, __pyx_pybuffernd_inds.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_inds.diminfo[0].strides));
23898 :
23899 : /* "scipy/sparse/csgraph/_reordering.pyx":128
23900 : * if inds[zz] != -1: # Do BFS with seed=inds[zz]
23901 : * seed = inds[zz]
23902 : * order[N] = seed # <<<<<<<<<<<<<<
23903 : * N += 1
23904 : * inds[rev_inds[seed]] = -1
23905 : */
23906 5 : __pyx_t_14 = __pyx_v_N;
23907 5 : __pyx_t_15 = -1;
23908 5 : if (__pyx_t_14 < 0) {
23909 0 : __pyx_t_14 += __pyx_pybuffernd_order.diminfo[0].shape;
23910 0 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
23911 5 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_order.diminfo[0].shape)) __pyx_t_15 = 0;
23912 5 : if (unlikely(__pyx_t_15 != -1)) {
23913 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
23914 0 : __PYX_ERR(0, 128, __pyx_L1_error)
23915 : }
23916 5 : *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_order.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_order.diminfo[0].strides) = __pyx_v_seed;
23917 :
23918 : /* "scipy/sparse/csgraph/_reordering.pyx":129
23919 : * seed = inds[zz]
23920 : * order[N] = seed
23921 : * N += 1 # <<<<<<<<<<<<<<
23922 : * inds[rev_inds[seed]] = -1
23923 : * level_start = N - 1
23924 : */
23925 5 : __pyx_v_N = (__pyx_v_N + 1);
23926 :
23927 : /* "scipy/sparse/csgraph/_reordering.pyx":130
23928 : * order[N] = seed
23929 : * N += 1
23930 : * inds[rev_inds[seed]] = -1 # <<<<<<<<<<<<<<
23931 : * level_start = N - 1
23932 : * level_end = N
23933 : */
23934 5 : __pyx_t_17 = __pyx_v_seed;
23935 5 : __pyx_t_15 = -1;
23936 5 : if (__pyx_t_17 < 0) {
23937 0 : __pyx_t_17 += __pyx_pybuffernd_rev_inds.diminfo[0].shape;
23938 0 : if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 0;
23939 5 : } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_rev_inds.diminfo[0].shape)) __pyx_t_15 = 0;
23940 5 : if (unlikely(__pyx_t_15 != -1)) {
23941 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
23942 0 : __PYX_ERR(0, 130, __pyx_L1_error)
23943 : }
23944 5 : __pyx_t_14 = (*__Pyx_BufPtrStrided1d(npy_intp *, __pyx_pybuffernd_rev_inds.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_rev_inds.diminfo[0].strides));
23945 5 : __pyx_t_15 = -1;
23946 5 : if (__pyx_t_14 < 0) {
23947 0 : __pyx_t_14 += __pyx_pybuffernd_inds.diminfo[0].shape;
23948 0 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
23949 5 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_inds.diminfo[0].shape)) __pyx_t_15 = 0;
23950 5 : if (unlikely(__pyx_t_15 != -1)) {
23951 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
23952 0 : __PYX_ERR(0, 130, __pyx_L1_error)
23953 : }
23954 5 : *__Pyx_BufPtrStrided1d(npy_intp *, __pyx_pybuffernd_inds.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_inds.diminfo[0].strides) = -1L;
23955 :
23956 : /* "scipy/sparse/csgraph/_reordering.pyx":131
23957 : * N += 1
23958 : * inds[rev_inds[seed]] = -1
23959 : * level_start = N - 1 # <<<<<<<<<<<<<<
23960 : * level_end = N
23961 : *
23962 : */
23963 5 : __pyx_v_level_start = (__pyx_v_N - 1);
23964 :
23965 : /* "scipy/sparse/csgraph/_reordering.pyx":132
23966 : * inds[rev_inds[seed]] = -1
23967 : * level_start = N - 1
23968 : * level_end = N # <<<<<<<<<<<<<<
23969 : *
23970 : * while level_start < level_end:
23971 : */
23972 5 : __pyx_v_level_end = __pyx_v_N;
23973 :
23974 : /* "scipy/sparse/csgraph/_reordering.pyx":134
23975 : * level_end = N
23976 : *
23977 : * while level_start < level_end: # <<<<<<<<<<<<<<
23978 : * for ii in range(level_start, level_end):
23979 : * i = order[ii]
23980 : */
23981 21 : while (1) {
23982 21 : __pyx_t_16 = (__pyx_v_level_start < __pyx_v_level_end);
23983 21 : if (!__pyx_t_16) break;
23984 :
23985 : /* "scipy/sparse/csgraph/_reordering.pyx":135
23986 : *
23987 : * while level_start < level_end:
23988 : * for ii in range(level_start, level_end): # <<<<<<<<<<<<<<
23989 : * i = order[ii]
23990 : * N_old = N
23991 : */
23992 : __pyx_t_18 = __pyx_v_level_end;
23993 : __pyx_t_19 = __pyx_t_18;
23994 40 : for (__pyx_t_20 = __pyx_v_level_start; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
23995 24 : __pyx_v_ii = __pyx_t_20;
23996 :
23997 : /* "scipy/sparse/csgraph/_reordering.pyx":136
23998 : * while level_start < level_end:
23999 : * for ii in range(level_start, level_end):
24000 : * i = order[ii] # <<<<<<<<<<<<<<
24001 : * N_old = N
24002 : *
24003 : */
24004 24 : __pyx_t_14 = __pyx_v_ii;
24005 24 : __pyx_t_15 = -1;
24006 24 : if (__pyx_t_14 < 0) {
24007 0 : __pyx_t_14 += __pyx_pybuffernd_order.diminfo[0].shape;
24008 0 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
24009 24 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_order.diminfo[0].shape)) __pyx_t_15 = 0;
24010 24 : if (unlikely(__pyx_t_15 != -1)) {
24011 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
24012 0 : __PYX_ERR(0, 136, __pyx_L1_error)
24013 : }
24014 24 : __pyx_v_i = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_order.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_order.diminfo[0].strides));
24015 :
24016 : /* "scipy/sparse/csgraph/_reordering.pyx":137
24017 : * for ii in range(level_start, level_end):
24018 : * i = order[ii]
24019 : * N_old = N # <<<<<<<<<<<<<<
24020 : *
24021 : * # add unvisited neighbors
24022 : */
24023 24 : __pyx_v_N_old = __pyx_v_N;
24024 :
24025 : /* "scipy/sparse/csgraph/_reordering.pyx":140
24026 : *
24027 : * # add unvisited neighbors
24028 : * for jj in range(ptr[i], ptr[i + 1]): # <<<<<<<<<<<<<<
24029 : * # j is node number connected to i
24030 : * j = ind[jj]
24031 : */
24032 24 : __pyx_t_17 = (__pyx_v_i + 1);
24033 24 : __pyx_t_15 = -1;
24034 24 : if (__pyx_t_17 < 0) {
24035 0 : __pyx_t_17 += __pyx_pybuffernd_ptr.diminfo[0].shape;
24036 0 : if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 0;
24037 24 : } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_ptr.diminfo[0].shape)) __pyx_t_15 = 0;
24038 24 : if (unlikely(__pyx_t_15 != -1)) {
24039 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
24040 0 : __PYX_ERR(0, 140, __pyx_L1_error)
24041 : }
24042 24 : __pyx_t_21 = (*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ptr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_ptr.diminfo[0].strides));
24043 24 : __pyx_t_17 = __pyx_v_i;
24044 24 : __pyx_t_15 = -1;
24045 24 : if (__pyx_t_17 < 0) {
24046 0 : __pyx_t_17 += __pyx_pybuffernd_ptr.diminfo[0].shape;
24047 0 : if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 0;
24048 24 : } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_ptr.diminfo[0].shape)) __pyx_t_15 = 0;
24049 24 : if (unlikely(__pyx_t_15 != -1)) {
24050 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
24051 0 : __PYX_ERR(0, 140, __pyx_L1_error)
24052 : }
24053 24 : __pyx_t_22 = __pyx_t_21;
24054 109 : for (__pyx_t_23 = (*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ptr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_ptr.diminfo[0].strides)); __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) {
24055 85 : __pyx_v_jj = __pyx_t_23;
24056 :
24057 : /* "scipy/sparse/csgraph/_reordering.pyx":142
24058 : * for jj in range(ptr[i], ptr[i + 1]):
24059 : * # j is node number connected to i
24060 : * j = ind[jj] # <<<<<<<<<<<<<<
24061 : * if inds[rev_inds[j]] != -1:
24062 : * inds[rev_inds[j]] = -1
24063 : */
24064 85 : __pyx_t_14 = __pyx_v_jj;
24065 85 : __pyx_t_15 = -1;
24066 85 : if (__pyx_t_14 < 0) {
24067 0 : __pyx_t_14 += __pyx_pybuffernd_ind.diminfo[0].shape;
24068 0 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
24069 85 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_ind.diminfo[0].shape)) __pyx_t_15 = 0;
24070 85 : if (unlikely(__pyx_t_15 != -1)) {
24071 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
24072 0 : __PYX_ERR(0, 142, __pyx_L1_error)
24073 : }
24074 85 : __pyx_v_j = (*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ind.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_ind.diminfo[0].strides));
24075 :
24076 : /* "scipy/sparse/csgraph/_reordering.pyx":143
24077 : * # j is node number connected to i
24078 : * j = ind[jj]
24079 : * if inds[rev_inds[j]] != -1: # <<<<<<<<<<<<<<
24080 : * inds[rev_inds[j]] = -1
24081 : * order[N] = j
24082 : */
24083 85 : __pyx_t_24 = __pyx_v_j;
24084 85 : __pyx_t_15 = -1;
24085 85 : if (__pyx_t_24 < 0) {
24086 0 : __pyx_t_24 += __pyx_pybuffernd_rev_inds.diminfo[0].shape;
24087 0 : if (unlikely(__pyx_t_24 < 0)) __pyx_t_15 = 0;
24088 85 : } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_rev_inds.diminfo[0].shape)) __pyx_t_15 = 0;
24089 85 : if (unlikely(__pyx_t_15 != -1)) {
24090 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
24091 0 : __PYX_ERR(0, 143, __pyx_L1_error)
24092 : }
24093 85 : __pyx_t_14 = (*__Pyx_BufPtrStrided1d(npy_intp *, __pyx_pybuffernd_rev_inds.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_rev_inds.diminfo[0].strides));
24094 85 : __pyx_t_15 = -1;
24095 85 : if (__pyx_t_14 < 0) {
24096 0 : __pyx_t_14 += __pyx_pybuffernd_inds.diminfo[0].shape;
24097 0 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
24098 85 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_inds.diminfo[0].shape)) __pyx_t_15 = 0;
24099 85 : if (unlikely(__pyx_t_15 != -1)) {
24100 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
24101 0 : __PYX_ERR(0, 143, __pyx_L1_error)
24102 : }
24103 85 : __pyx_t_16 = ((*__Pyx_BufPtrStrided1d(npy_intp *, __pyx_pybuffernd_inds.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_inds.diminfo[0].strides)) != -1L);
24104 85 : if (__pyx_t_16) {
24105 :
24106 : /* "scipy/sparse/csgraph/_reordering.pyx":144
24107 : * j = ind[jj]
24108 : * if inds[rev_inds[j]] != -1:
24109 : * inds[rev_inds[j]] = -1 # <<<<<<<<<<<<<<
24110 : * order[N] = j
24111 : * N += 1
24112 : */
24113 19 : __pyx_t_24 = __pyx_v_j;
24114 19 : __pyx_t_15 = -1;
24115 19 : if (__pyx_t_24 < 0) {
24116 0 : __pyx_t_24 += __pyx_pybuffernd_rev_inds.diminfo[0].shape;
24117 0 : if (unlikely(__pyx_t_24 < 0)) __pyx_t_15 = 0;
24118 19 : } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_rev_inds.diminfo[0].shape)) __pyx_t_15 = 0;
24119 19 : if (unlikely(__pyx_t_15 != -1)) {
24120 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
24121 0 : __PYX_ERR(0, 144, __pyx_L1_error)
24122 : }
24123 19 : __pyx_t_14 = (*__Pyx_BufPtrStrided1d(npy_intp *, __pyx_pybuffernd_rev_inds.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_rev_inds.diminfo[0].strides));
24124 19 : __pyx_t_15 = -1;
24125 19 : if (__pyx_t_14 < 0) {
24126 0 : __pyx_t_14 += __pyx_pybuffernd_inds.diminfo[0].shape;
24127 0 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
24128 19 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_inds.diminfo[0].shape)) __pyx_t_15 = 0;
24129 19 : if (unlikely(__pyx_t_15 != -1)) {
24130 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
24131 0 : __PYX_ERR(0, 144, __pyx_L1_error)
24132 : }
24133 19 : *__Pyx_BufPtrStrided1d(npy_intp *, __pyx_pybuffernd_inds.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_inds.diminfo[0].strides) = -1L;
24134 :
24135 : /* "scipy/sparse/csgraph/_reordering.pyx":145
24136 : * if inds[rev_inds[j]] != -1:
24137 : * inds[rev_inds[j]] = -1
24138 : * order[N] = j # <<<<<<<<<<<<<<
24139 : * N += 1
24140 : *
24141 : */
24142 19 : __pyx_t_14 = __pyx_v_N;
24143 19 : __pyx_t_15 = -1;
24144 19 : if (__pyx_t_14 < 0) {
24145 0 : __pyx_t_14 += __pyx_pybuffernd_order.diminfo[0].shape;
24146 0 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
24147 19 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_order.diminfo[0].shape)) __pyx_t_15 = 0;
24148 19 : if (unlikely(__pyx_t_15 != -1)) {
24149 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
24150 0 : __PYX_ERR(0, 145, __pyx_L1_error)
24151 : }
24152 19 : *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_order.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_order.diminfo[0].strides) = __pyx_v_j;
24153 :
24154 : /* "scipy/sparse/csgraph/_reordering.pyx":146
24155 : * inds[rev_inds[j]] = -1
24156 : * order[N] = j
24157 : * N += 1 # <<<<<<<<<<<<<<
24158 : *
24159 : * # Add values to temp_degrees array for insertion sort
24160 : */
24161 19 : __pyx_v_N = (__pyx_v_N + 1);
24162 :
24163 : /* "scipy/sparse/csgraph/_reordering.pyx":143
24164 : * # j is node number connected to i
24165 : * j = ind[jj]
24166 : * if inds[rev_inds[j]] != -1: # <<<<<<<<<<<<<<
24167 : * inds[rev_inds[j]] = -1
24168 : * order[N] = j
24169 : */
24170 : }
24171 : }
24172 :
24173 : /* "scipy/sparse/csgraph/_reordering.pyx":149
24174 : *
24175 : * # Add values to temp_degrees array for insertion sort
24176 : * level_len = 0 # <<<<<<<<<<<<<<
24177 : * for kk in range(N_old, N):
24178 : * temp_degrees[level_len] = degree[order[kk]]
24179 : */
24180 : __pyx_v_level_len = 0;
24181 :
24182 : /* "scipy/sparse/csgraph/_reordering.pyx":150
24183 : * # Add values to temp_degrees array for insertion sort
24184 : * level_len = 0
24185 : * for kk in range(N_old, N): # <<<<<<<<<<<<<<
24186 : * temp_degrees[level_len] = degree[order[kk]]
24187 : * level_len += 1
24188 : */
24189 43 : __pyx_t_23 = __pyx_v_N;
24190 : __pyx_t_25 = __pyx_t_23;
24191 43 : for (__pyx_t_26 = __pyx_v_N_old; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
24192 19 : __pyx_v_kk = __pyx_t_26;
24193 :
24194 : /* "scipy/sparse/csgraph/_reordering.pyx":151
24195 : * level_len = 0
24196 : * for kk in range(N_old, N):
24197 : * temp_degrees[level_len] = degree[order[kk]] # <<<<<<<<<<<<<<
24198 : * level_len += 1
24199 : *
24200 : */
24201 19 : __pyx_t_14 = __pyx_v_kk;
24202 19 : __pyx_t_15 = -1;
24203 19 : if (__pyx_t_14 < 0) {
24204 0 : __pyx_t_14 += __pyx_pybuffernd_order.diminfo[0].shape;
24205 0 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
24206 19 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_order.diminfo[0].shape)) __pyx_t_15 = 0;
24207 19 : if (unlikely(__pyx_t_15 != -1)) {
24208 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
24209 0 : __PYX_ERR(0, 151, __pyx_L1_error)
24210 : }
24211 19 : __pyx_t_21 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_order.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_order.diminfo[0].strides));
24212 19 : __pyx_t_15 = -1;
24213 19 : if (__pyx_t_21 < 0) {
24214 0 : __pyx_t_21 += __pyx_pybuffernd_degree.diminfo[0].shape;
24215 0 : if (unlikely(__pyx_t_21 < 0)) __pyx_t_15 = 0;
24216 19 : } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_degree.diminfo[0].shape)) __pyx_t_15 = 0;
24217 19 : if (unlikely(__pyx_t_15 != -1)) {
24218 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
24219 0 : __PYX_ERR(0, 151, __pyx_L1_error)
24220 : }
24221 19 : __pyx_t_27 = __pyx_v_level_len;
24222 19 : __pyx_t_15 = -1;
24223 19 : if (__pyx_t_27 < 0) {
24224 : __pyx_t_27 += __pyx_pybuffernd_temp_degrees.diminfo[0].shape;
24225 : if (unlikely(__pyx_t_27 < 0)) __pyx_t_15 = 0;
24226 19 : } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_temp_degrees.diminfo[0].shape)) __pyx_t_15 = 0;
24227 19 : if (unlikely(__pyx_t_15 != -1)) {
24228 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
24229 0 : __PYX_ERR(0, 151, __pyx_L1_error)
24230 : }
24231 19 : *__Pyx_BufPtrStrided1d(__pyx_t_5scipy_6sparse_7csgraph_11_reordering_ITYPE_t *, __pyx_pybuffernd_temp_degrees.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_temp_degrees.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_degree.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_degree.diminfo[0].strides));
24232 :
24233 : /* "scipy/sparse/csgraph/_reordering.pyx":152
24234 : * for kk in range(N_old, N):
24235 : * temp_degrees[level_len] = degree[order[kk]]
24236 : * level_len += 1 # <<<<<<<<<<<<<<
24237 : *
24238 : * # Do insertion sort for nodes from lowest to highest degree
24239 : */
24240 19 : __pyx_v_level_len = (__pyx_v_level_len + 1);
24241 : }
24242 :
24243 : /* "scipy/sparse/csgraph/_reordering.pyx":155
24244 : *
24245 : * # Do insertion sort for nodes from lowest to highest degree
24246 : * for kk in range(1,level_len): # <<<<<<<<<<<<<<
24247 : * temp = temp_degrees[kk]
24248 : * temp2 = order[N_old+kk]
24249 : */
24250 30 : __pyx_t_23 = __pyx_v_level_len;
24251 : __pyx_t_25 = __pyx_t_23;
24252 30 : for (__pyx_t_26 = 1; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
24253 6 : __pyx_v_kk = __pyx_t_26;
24254 :
24255 : /* "scipy/sparse/csgraph/_reordering.pyx":156
24256 : * # Do insertion sort for nodes from lowest to highest degree
24257 : * for kk in range(1,level_len):
24258 : * temp = temp_degrees[kk] # <<<<<<<<<<<<<<
24259 : * temp2 = order[N_old+kk]
24260 : * ll = kk
24261 : */
24262 6 : __pyx_t_14 = __pyx_v_kk;
24263 6 : __pyx_t_15 = -1;
24264 6 : if (__pyx_t_14 < 0) {
24265 : __pyx_t_14 += __pyx_pybuffernd_temp_degrees.diminfo[0].shape;
24266 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
24267 6 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_temp_degrees.diminfo[0].shape)) __pyx_t_15 = 0;
24268 6 : if (unlikely(__pyx_t_15 != -1)) {
24269 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
24270 0 : __PYX_ERR(0, 156, __pyx_L1_error)
24271 : }
24272 6 : __pyx_v_temp = (*__Pyx_BufPtrStrided1d(__pyx_t_5scipy_6sparse_7csgraph_11_reordering_ITYPE_t *, __pyx_pybuffernd_temp_degrees.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_temp_degrees.diminfo[0].strides));
24273 :
24274 : /* "scipy/sparse/csgraph/_reordering.pyx":157
24275 : * for kk in range(1,level_len):
24276 : * temp = temp_degrees[kk]
24277 : * temp2 = order[N_old+kk] # <<<<<<<<<<<<<<
24278 : * ll = kk
24279 : * while (ll > 0) and (temp < temp_degrees[ll-1]):
24280 : */
24281 6 : __pyx_t_14 = (__pyx_v_N_old + __pyx_v_kk);
24282 6 : __pyx_t_15 = -1;
24283 6 : if (__pyx_t_14 < 0) {
24284 0 : __pyx_t_14 += __pyx_pybuffernd_order.diminfo[0].shape;
24285 0 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
24286 6 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_order.diminfo[0].shape)) __pyx_t_15 = 0;
24287 6 : if (unlikely(__pyx_t_15 != -1)) {
24288 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
24289 0 : __PYX_ERR(0, 157, __pyx_L1_error)
24290 : }
24291 6 : __pyx_v_temp2 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_order.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_order.diminfo[0].strides));
24292 :
24293 : /* "scipy/sparse/csgraph/_reordering.pyx":158
24294 : * temp = temp_degrees[kk]
24295 : * temp2 = order[N_old+kk]
24296 : * ll = kk # <<<<<<<<<<<<<<
24297 : * while (ll > 0) and (temp < temp_degrees[ll-1]):
24298 : * temp_degrees[ll] = temp_degrees[ll-1]
24299 : */
24300 6 : __pyx_v_ll = __pyx_v_kk;
24301 :
24302 : /* "scipy/sparse/csgraph/_reordering.pyx":159
24303 : * temp2 = order[N_old+kk]
24304 : * ll = kk
24305 : * while (ll > 0) and (temp < temp_degrees[ll-1]): # <<<<<<<<<<<<<<
24306 : * temp_degrees[ll] = temp_degrees[ll-1]
24307 : * order[N_old+ll] = order[N_old+ll-1]
24308 : */
24309 10 : while (1) {
24310 8 : __pyx_t_28 = (__pyx_v_ll > 0);
24311 8 : if (__pyx_t_28) {
24312 7 : } else {
24313 1 : __pyx_t_16 = __pyx_t_28;
24314 1 : goto __pyx_L19_bool_binop_done;
24315 : }
24316 7 : __pyx_t_14 = (__pyx_v_ll - 1);
24317 7 : __pyx_t_15 = -1;
24318 7 : if (__pyx_t_14 < 0) {
24319 : __pyx_t_14 += __pyx_pybuffernd_temp_degrees.diminfo[0].shape;
24320 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
24321 7 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_temp_degrees.diminfo[0].shape)) __pyx_t_15 = 0;
24322 7 : if (unlikely(__pyx_t_15 != -1)) {
24323 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
24324 0 : __PYX_ERR(0, 159, __pyx_L1_error)
24325 : }
24326 7 : __pyx_t_28 = (__pyx_v_temp < (*__Pyx_BufPtrStrided1d(__pyx_t_5scipy_6sparse_7csgraph_11_reordering_ITYPE_t *, __pyx_pybuffernd_temp_degrees.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_temp_degrees.diminfo[0].strides)));
24327 7 : __pyx_t_16 = __pyx_t_28;
24328 8 : __pyx_L19_bool_binop_done:;
24329 8 : if (!__pyx_t_16) break;
24330 :
24331 : /* "scipy/sparse/csgraph/_reordering.pyx":160
24332 : * ll = kk
24333 : * while (ll > 0) and (temp < temp_degrees[ll-1]):
24334 : * temp_degrees[ll] = temp_degrees[ll-1] # <<<<<<<<<<<<<<
24335 : * order[N_old+ll] = order[N_old+ll-1]
24336 : * ll -= 1
24337 : */
24338 2 : __pyx_t_14 = (__pyx_v_ll - 1);
24339 2 : __pyx_t_15 = -1;
24340 2 : if (__pyx_t_14 < 0) {
24341 0 : __pyx_t_14 += __pyx_pybuffernd_temp_degrees.diminfo[0].shape;
24342 0 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
24343 2 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_temp_degrees.diminfo[0].shape)) __pyx_t_15 = 0;
24344 2 : if (unlikely(__pyx_t_15 != -1)) {
24345 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
24346 0 : __PYX_ERR(0, 160, __pyx_L1_error)
24347 : }
24348 2 : __pyx_t_27 = __pyx_v_ll;
24349 2 : __pyx_t_15 = -1;
24350 2 : if (__pyx_t_27 < 0) {
24351 0 : __pyx_t_27 += __pyx_pybuffernd_temp_degrees.diminfo[0].shape;
24352 0 : if (unlikely(__pyx_t_27 < 0)) __pyx_t_15 = 0;
24353 2 : } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_temp_degrees.diminfo[0].shape)) __pyx_t_15 = 0;
24354 2 : if (unlikely(__pyx_t_15 != -1)) {
24355 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
24356 0 : __PYX_ERR(0, 160, __pyx_L1_error)
24357 : }
24358 2 : *__Pyx_BufPtrStrided1d(__pyx_t_5scipy_6sparse_7csgraph_11_reordering_ITYPE_t *, __pyx_pybuffernd_temp_degrees.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_temp_degrees.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5scipy_6sparse_7csgraph_11_reordering_ITYPE_t *, __pyx_pybuffernd_temp_degrees.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_temp_degrees.diminfo[0].strides));
24359 :
24360 : /* "scipy/sparse/csgraph/_reordering.pyx":161
24361 : * while (ll > 0) and (temp < temp_degrees[ll-1]):
24362 : * temp_degrees[ll] = temp_degrees[ll-1]
24363 : * order[N_old+ll] = order[N_old+ll-1] # <<<<<<<<<<<<<<
24364 : * ll -= 1
24365 : * temp_degrees[ll] = temp
24366 : */
24367 2 : __pyx_t_14 = ((__pyx_v_N_old + __pyx_v_ll) - 1);
24368 2 : __pyx_t_15 = -1;
24369 2 : if (__pyx_t_14 < 0) {
24370 0 : __pyx_t_14 += __pyx_pybuffernd_order.diminfo[0].shape;
24371 0 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
24372 2 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_order.diminfo[0].shape)) __pyx_t_15 = 0;
24373 2 : if (unlikely(__pyx_t_15 != -1)) {
24374 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
24375 0 : __PYX_ERR(0, 161, __pyx_L1_error)
24376 : }
24377 2 : __pyx_t_27 = (__pyx_v_N_old + __pyx_v_ll);
24378 2 : __pyx_t_15 = -1;
24379 2 : if (__pyx_t_27 < 0) {
24380 0 : __pyx_t_27 += __pyx_pybuffernd_order.diminfo[0].shape;
24381 0 : if (unlikely(__pyx_t_27 < 0)) __pyx_t_15 = 0;
24382 2 : } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_order.diminfo[0].shape)) __pyx_t_15 = 0;
24383 2 : if (unlikely(__pyx_t_15 != -1)) {
24384 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
24385 0 : __PYX_ERR(0, 161, __pyx_L1_error)
24386 : }
24387 2 : *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_order.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_order.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_order.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_order.diminfo[0].strides));
24388 :
24389 : /* "scipy/sparse/csgraph/_reordering.pyx":162
24390 : * temp_degrees[ll] = temp_degrees[ll-1]
24391 : * order[N_old+ll] = order[N_old+ll-1]
24392 : * ll -= 1 # <<<<<<<<<<<<<<
24393 : * temp_degrees[ll] = temp
24394 : * order[N_old+ll] = temp2
24395 : */
24396 2 : __pyx_v_ll = (__pyx_v_ll - 1);
24397 : }
24398 :
24399 : /* "scipy/sparse/csgraph/_reordering.pyx":163
24400 : * order[N_old+ll] = order[N_old+ll-1]
24401 : * ll -= 1
24402 : * temp_degrees[ll] = temp # <<<<<<<<<<<<<<
24403 : * order[N_old+ll] = temp2
24404 : *
24405 : */
24406 6 : __pyx_t_14 = __pyx_v_ll;
24407 6 : __pyx_t_15 = -1;
24408 6 : if (__pyx_t_14 < 0) {
24409 0 : __pyx_t_14 += __pyx_pybuffernd_temp_degrees.diminfo[0].shape;
24410 0 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
24411 6 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_temp_degrees.diminfo[0].shape)) __pyx_t_15 = 0;
24412 6 : if (unlikely(__pyx_t_15 != -1)) {
24413 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
24414 0 : __PYX_ERR(0, 163, __pyx_L1_error)
24415 : }
24416 6 : *__Pyx_BufPtrStrided1d(__pyx_t_5scipy_6sparse_7csgraph_11_reordering_ITYPE_t *, __pyx_pybuffernd_temp_degrees.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_temp_degrees.diminfo[0].strides) = __pyx_v_temp;
24417 :
24418 : /* "scipy/sparse/csgraph/_reordering.pyx":164
24419 : * ll -= 1
24420 : * temp_degrees[ll] = temp
24421 : * order[N_old+ll] = temp2 # <<<<<<<<<<<<<<
24422 : *
24423 : * # set next level start and end ranges
24424 : */
24425 6 : __pyx_t_14 = (__pyx_v_N_old + __pyx_v_ll);
24426 6 : __pyx_t_15 = -1;
24427 6 : if (__pyx_t_14 < 0) {
24428 0 : __pyx_t_14 += __pyx_pybuffernd_order.diminfo[0].shape;
24429 0 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
24430 6 : } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_order.diminfo[0].shape)) __pyx_t_15 = 0;
24431 6 : if (unlikely(__pyx_t_15 != -1)) {
24432 0 : __Pyx_RaiseBufferIndexError(__pyx_t_15);
24433 0 : __PYX_ERR(0, 164, __pyx_L1_error)
24434 : }
24435 6 : *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_order.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_order.diminfo[0].strides) = __pyx_v_temp2;
24436 : }
24437 : }
24438 :
24439 : /* "scipy/sparse/csgraph/_reordering.pyx":167
24440 : *
24441 : * # set next level start and end ranges
24442 : * level_start = level_end # <<<<<<<<<<<<<<
24443 : * level_end = N
24444 : *
24445 : */
24446 : __pyx_v_level_start = __pyx_v_level_end;
24447 :
24448 : /* "scipy/sparse/csgraph/_reordering.pyx":168
24449 : * # set next level start and end ranges
24450 : * level_start = level_end
24451 : * level_end = N # <<<<<<<<<<<<<<
24452 : *
24453 : * if N == num_rows:
24454 : */
24455 : __pyx_v_level_end = __pyx_v_N;
24456 : }
24457 :
24458 : /* "scipy/sparse/csgraph/_reordering.pyx":126
24459 : * # loop over zz takes into account possible disconnected graph.
24460 : * for zz in range(num_rows):
24461 : * if inds[zz] != -1: # Do BFS with seed=inds[zz] # <<<<<<<<<<<<<<
24462 : * seed = inds[zz]
24463 : * order[N] = seed
24464 : */
24465 : }
24466 :
24467 : /* "scipy/sparse/csgraph/_reordering.pyx":170
24468 : * level_end = N
24469 : *
24470 : * if N == num_rows: # <<<<<<<<<<<<<<
24471 : * break
24472 : *
24473 : */
24474 5 : __pyx_t_16 = (__pyx_v_N == __pyx_v_num_rows);
24475 5 : if (__pyx_t_16) {
24476 :
24477 : /* "scipy/sparse/csgraph/_reordering.pyx":171
24478 : *
24479 : * if N == num_rows:
24480 : * break # <<<<<<<<<<<<<<
24481 : *
24482 : * # return reversed order for RCM ordering
24483 : */
24484 2 : goto __pyx_L4_break;
24485 :
24486 : /* "scipy/sparse/csgraph/_reordering.pyx":170
24487 : * level_end = N
24488 : *
24489 : * if N == num_rows: # <<<<<<<<<<<<<<
24490 : * break
24491 : *
24492 : */
24493 : }
24494 : }
24495 0 : __pyx_L4_break:;
24496 :
24497 : /* "scipy/sparse/csgraph/_reordering.pyx":174
24498 : *
24499 : * # return reversed order for RCM ordering
24500 : * return order[::-1] # <<<<<<<<<<<<<<
24501 : *
24502 : *
24503 : */
24504 2 : __Pyx_XDECREF(__pyx_r);
24505 2 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_order), __pyx_slice__17); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L1_error)
24506 2 : __Pyx_GOTREF(__pyx_t_3);
24507 2 : __pyx_r = __pyx_t_3;
24508 2 : __pyx_t_3 = 0;
24509 2 : goto __pyx_L0;
24510 :
24511 : /* "scipy/sparse/csgraph/_reordering.pyx":107
24512 : *
24513 : *
24514 : * def _reverse_cuthill_mckee(np.ndarray[int32_or_int64, ndim=1, mode="c"] ind, # <<<<<<<<<<<<<<
24515 : * np.ndarray[int32_or_int64, ndim=1, mode="c"] ptr,
24516 : * np.npy_intp num_rows):
24517 : */
24518 :
24519 : /* function exit code */
24520 0 : __pyx_L1_error:;
24521 0 : __Pyx_XDECREF(__pyx_t_1);
24522 0 : __Pyx_XDECREF(__pyx_t_2);
24523 0 : __Pyx_XDECREF(__pyx_t_3);
24524 0 : __Pyx_XDECREF(__pyx_t_4);
24525 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
24526 0 : __Pyx_PyThreadState_declare
24527 0 : __Pyx_PyThreadState_assign
24528 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
24529 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_degree.rcbuffer->pybuffer);
24530 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ind.rcbuffer->pybuffer);
24531 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer);
24532 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_order.rcbuffer->pybuffer);
24533 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ptr.rcbuffer->pybuffer);
24534 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rev_inds.rcbuffer->pybuffer);
24535 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_temp_degrees.rcbuffer->pybuffer);
24536 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
24537 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._reordering._reverse_cuthill_mckee", __pyx_clineno, __pyx_lineno, __pyx_filename);
24538 0 : __pyx_r = NULL;
24539 0 : goto __pyx_L2;
24540 2 : __pyx_L0:;
24541 2 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_degree.rcbuffer->pybuffer);
24542 2 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ind.rcbuffer->pybuffer);
24543 2 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer);
24544 2 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_order.rcbuffer->pybuffer);
24545 2 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ptr.rcbuffer->pybuffer);
24546 2 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rev_inds.rcbuffer->pybuffer);
24547 2 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_temp_degrees.rcbuffer->pybuffer);
24548 2 : __pyx_L2:;
24549 2 : __Pyx_XDECREF((PyObject *)__pyx_v_order);
24550 2 : __Pyx_XDECREF((PyObject *)__pyx_v_degree);
24551 2 : __Pyx_XDECREF((PyObject *)__pyx_v_inds);
24552 2 : __Pyx_XDECREF((PyObject *)__pyx_v_rev_inds);
24553 2 : __Pyx_XDECREF((PyObject *)__pyx_v_temp_degrees);
24554 2 : __Pyx_XGIVEREF(__pyx_r);
24555 2 : __Pyx_RefNannyFinishContext();
24556 2 : return __pyx_r;
24557 : }
24558 :
24559 : /* "scipy/sparse/csgraph/_reordering.pyx":177
24560 : *
24561 : *
24562 : * def structural_rank(graph): # <<<<<<<<<<<<<<
24563 : * """
24564 : * structural_rank(graph)
24565 : */
24566 :
24567 : /* Python wrapper */
24568 : static PyObject *__pyx_pw_5scipy_6sparse_7csgraph_11_reordering_5structural_rank(PyObject *__pyx_self,
24569 : #if CYTHON_METH_FASTCALL
24570 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24571 : #else
24572 : PyObject *__pyx_args, PyObject *__pyx_kwds
24573 : #endif
24574 : ); /*proto*/
24575 : PyDoc_STRVAR(__pyx_doc_5scipy_6sparse_7csgraph_11_reordering_4structural_rank, "\n structural_rank(graph)\n \n Compute the structural rank of a graph (matrix) with a given \n sparsity pattern.\n\n The structural rank of a matrix is the number of entries in the maximum \n transversal of the corresponding bipartite graph, and is an upper bound \n on the numerical rank of the matrix. A graph has full structural rank \n if it is possible to permute the elements to make the diagonal zero-free.\n\n .. versionadded:: 0.19.0\n\n Parameters\n ----------\n graph : sparse array or matrix\n Input sparse array.\n\n Returns\n -------\n rank : int\n The structural rank of the sparse graph.\n \n References\n ----------\n .. [1] I. S. Duff, \"Computing the Structural Index\", SIAM J. Alg. Disc. \n Meth., Vol. 7, 594 (1986).\n \n .. [2] http://www.cise.ufl.edu/research/sparse/matrices/legend.html\n\n Examples\n --------\n >>> from scipy.sparse import csr_array\n >>> from scipy.sparse.csgraph import structural_rank\n\n >>> graph = [\n ... [0, 1, 2, 0],\n ... [1, 0, 0, 1],\n ... [2, 0, 0, 3],\n ... [0, 1, 3, 0]\n ... ]\n >>> graph = csr_array(graph)\n >>> print(graph)\n <Compressed Sparse Row sparse array of dtype 'int64'\n with 8 stored elements and shape (4, 4)>\n Coords\tValues\n (0, 1)\t1\n (0, 2)\t2\n (1, 0)\t1\n (1, 3)\t1\n (2, 0)\t2\n (2, 3)\t3\n (3, 1)\t1\n (3, 2)\t3\n\n >>> structural_rank(graph)\n 4\n\n ");
24576 : static PyMethodDef __pyx_mdef_5scipy_6sparse_7csgraph_11_reordering_5structural_rank = {"structural_rank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6sparse_7csgraph_11_reordering_5structural_rank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_6sparse_7csgraph_11_reordering_4structural_rank};
24577 4 : static PyObject *__pyx_pw_5scipy_6sparse_7csgraph_11_reordering_5structural_rank(PyObject *__pyx_self,
24578 : #if CYTHON_METH_FASTCALL
24579 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24580 : #else
24581 : PyObject *__pyx_args, PyObject *__pyx_kwds
24582 : #endif
24583 : ) {
24584 4 : PyObject *__pyx_v_graph = 0;
24585 : #if !CYTHON_METH_FASTCALL
24586 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
24587 : #endif
24588 4 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
24589 4 : PyObject* values[1] = {0};
24590 4 : int __pyx_lineno = 0;
24591 4 : const char *__pyx_filename = NULL;
24592 4 : int __pyx_clineno = 0;
24593 4 : PyObject *__pyx_r = 0;
24594 : __Pyx_RefNannyDeclarations
24595 4 : __Pyx_RefNannySetupContext("structural_rank (wrapper)", 0);
24596 : #if !CYTHON_METH_FASTCALL
24597 : #if CYTHON_ASSUME_SAFE_MACROS
24598 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24599 : #else
24600 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
24601 : #endif
24602 : #endif
24603 4 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
24604 : {
24605 4 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_graph,0};
24606 4 : if (__pyx_kwds) {
24607 0 : Py_ssize_t kw_args;
24608 0 : switch (__pyx_nargs) {
24609 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
24610 0 : CYTHON_FALLTHROUGH;
24611 0 : case 0: break;
24612 0 : default: goto __pyx_L5_argtuple_error;
24613 : }
24614 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
24615 0 : switch (__pyx_nargs) {
24616 : case 0:
24617 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_graph)) != 0)) {
24618 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
24619 0 : kw_args--;
24620 : }
24621 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L3_error)
24622 0 : else goto __pyx_L5_argtuple_error;
24623 : }
24624 0 : if (unlikely(kw_args > 0)) {
24625 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
24626 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "structural_rank") < 0)) __PYX_ERR(0, 177, __pyx_L3_error)
24627 : }
24628 4 : } else if (unlikely(__pyx_nargs != 1)) {
24629 0 : goto __pyx_L5_argtuple_error;
24630 : } else {
24631 4 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
24632 : }
24633 4 : __pyx_v_graph = values[0];
24634 : }
24635 4 : goto __pyx_L6_skip;
24636 0 : __pyx_L5_argtuple_error:;
24637 0 : __Pyx_RaiseArgtupleInvalid("structural_rank", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 177, __pyx_L3_error)
24638 4 : __pyx_L6_skip:;
24639 4 : goto __pyx_L4_argument_unpacking_done;
24640 0 : __pyx_L3_error:;
24641 : {
24642 0 : Py_ssize_t __pyx_temp;
24643 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24644 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
24645 : }
24646 : }
24647 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._reordering.structural_rank", __pyx_clineno, __pyx_lineno, __pyx_filename);
24648 0 : __Pyx_RefNannyFinishContext();
24649 0 : return NULL;
24650 4 : __pyx_L4_argument_unpacking_done:;
24651 4 : __pyx_r = __pyx_pf_5scipy_6sparse_7csgraph_11_reordering_4structural_rank(__pyx_self, __pyx_v_graph);
24652 :
24653 : /* function exit code */
24654 : {
24655 4 : Py_ssize_t __pyx_temp;
24656 4 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24657 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
24658 : }
24659 : }
24660 : __Pyx_RefNannyFinishContext();
24661 : return __pyx_r;
24662 : }
24663 :
24664 4 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_11_reordering_4structural_rank(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_graph) {
24665 4 : PyObject *__pyx_v_rank = NULL;
24666 4 : PyObject *__pyx_r = NULL;
24667 : __Pyx_RefNannyDeclarations
24668 4 : PyObject *__pyx_t_1 = NULL;
24669 4 : PyObject *__pyx_t_2 = NULL;
24670 4 : PyObject *__pyx_t_3 = NULL;
24671 4 : unsigned int __pyx_t_4;
24672 4 : int __pyx_t_5;
24673 4 : int __pyx_t_6;
24674 4 : PyObject *__pyx_t_7 = NULL;
24675 4 : PyObject *__pyx_t_8 = NULL;
24676 4 : int __pyx_lineno = 0;
24677 4 : const char *__pyx_filename = NULL;
24678 4 : int __pyx_clineno = 0;
24679 4 : __Pyx_RefNannySetupContext("structural_rank", 0);
24680 4 : __Pyx_INCREF(__pyx_v_graph);
24681 :
24682 : /* "scipy/sparse/csgraph/_reordering.pyx":237
24683 : *
24684 : * """
24685 : * graph = convert_pydata_sparse_to_scipy(graph) # <<<<<<<<<<<<<<
24686 : * if not issparse(graph):
24687 : * raise TypeError('Input must be sparse')
24688 : */
24689 4 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_convert_pydata_sparse_to_scipy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
24690 4 : __Pyx_GOTREF(__pyx_t_2);
24691 4 : __pyx_t_3 = NULL;
24692 4 : __pyx_t_4 = 0;
24693 : #if CYTHON_UNPACK_METHODS
24694 4 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
24695 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
24696 0 : if (likely(__pyx_t_3)) {
24697 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
24698 0 : __Pyx_INCREF(__pyx_t_3);
24699 0 : __Pyx_INCREF(function);
24700 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
24701 : __pyx_t_4 = 1;
24702 : }
24703 : }
24704 : #endif
24705 : {
24706 4 : PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_graph};
24707 4 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
24708 4 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
24709 4 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
24710 4 : __Pyx_GOTREF(__pyx_t_1);
24711 4 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24712 : }
24713 4 : __Pyx_DECREF_SET(__pyx_v_graph, __pyx_t_1);
24714 4 : __pyx_t_1 = 0;
24715 :
24716 : /* "scipy/sparse/csgraph/_reordering.pyx":238
24717 : * """
24718 : * graph = convert_pydata_sparse_to_scipy(graph)
24719 : * if not issparse(graph): # <<<<<<<<<<<<<<
24720 : * raise TypeError('Input must be sparse')
24721 : * if graph.format != "csr":
24722 : */
24723 4 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_issparse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error)
24724 4 : __Pyx_GOTREF(__pyx_t_2);
24725 4 : __pyx_t_3 = NULL;
24726 4 : __pyx_t_4 = 0;
24727 : #if CYTHON_UNPACK_METHODS
24728 4 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
24729 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
24730 0 : if (likely(__pyx_t_3)) {
24731 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
24732 0 : __Pyx_INCREF(__pyx_t_3);
24733 0 : __Pyx_INCREF(function);
24734 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
24735 : __pyx_t_4 = 1;
24736 : }
24737 : }
24738 : #endif
24739 : {
24740 4 : PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_graph};
24741 4 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
24742 4 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
24743 4 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
24744 4 : __Pyx_GOTREF(__pyx_t_1);
24745 4 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24746 : }
24747 4 : __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 238, __pyx_L1_error)
24748 4 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24749 4 : __pyx_t_6 = (!__pyx_t_5);
24750 4 : if (unlikely(__pyx_t_6)) {
24751 :
24752 : /* "scipy/sparse/csgraph/_reordering.pyx":239
24753 : * graph = convert_pydata_sparse_to_scipy(graph)
24754 : * if not issparse(graph):
24755 : * raise TypeError('Input must be sparse') # <<<<<<<<<<<<<<
24756 : * if graph.format != "csr":
24757 : * if graph.format not in ("csc", "coo"):
24758 : */
24759 0 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error)
24760 0 : __Pyx_GOTREF(__pyx_t_1);
24761 0 : __Pyx_Raise(__pyx_t_1, 0, 0, 0);
24762 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24763 0 : __PYX_ERR(0, 239, __pyx_L1_error)
24764 :
24765 : /* "scipy/sparse/csgraph/_reordering.pyx":238
24766 : * """
24767 : * graph = convert_pydata_sparse_to_scipy(graph)
24768 : * if not issparse(graph): # <<<<<<<<<<<<<<
24769 : * raise TypeError('Input must be sparse')
24770 : * if graph.format != "csr":
24771 : */
24772 : }
24773 :
24774 : /* "scipy/sparse/csgraph/_reordering.pyx":240
24775 : * if not issparse(graph):
24776 : * raise TypeError('Input must be sparse')
24777 : * if graph.format != "csr": # <<<<<<<<<<<<<<
24778 : * if graph.format not in ("csc", "coo"):
24779 : * warn('Input matrix should be in CSC, CSR, or COO matrix format',
24780 : */
24781 4 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
24782 4 : __Pyx_GOTREF(__pyx_t_1);
24783 4 : __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_csr, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 240, __pyx_L1_error)
24784 4 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24785 4 : if (__pyx_t_6) {
24786 :
24787 : /* "scipy/sparse/csgraph/_reordering.pyx":241
24788 : * raise TypeError('Input must be sparse')
24789 : * if graph.format != "csr":
24790 : * if graph.format not in ("csc", "coo"): # <<<<<<<<<<<<<<
24791 : * warn('Input matrix should be in CSC, CSR, or COO matrix format',
24792 : * SparseEfficiencyWarning)
24793 : */
24794 3 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error)
24795 3 : __Pyx_GOTREF(__pyx_t_1);
24796 3 : __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_csc, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 241, __pyx_L1_error)
24797 3 : if (__pyx_t_5) {
24798 1 : } else {
24799 2 : __pyx_t_6 = __pyx_t_5;
24800 2 : goto __pyx_L6_bool_binop_done;
24801 : }
24802 1 : __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_coo, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 241, __pyx_L1_error)
24803 : __pyx_t_6 = __pyx_t_5;
24804 3 : __pyx_L6_bool_binop_done:;
24805 3 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24806 3 : __pyx_t_5 = __pyx_t_6;
24807 3 : if (__pyx_t_5) {
24808 :
24809 : /* "scipy/sparse/csgraph/_reordering.pyx":242
24810 : * if graph.format != "csr":
24811 : * if graph.format not in ("csc", "coo"):
24812 : * warn('Input matrix should be in CSC, CSR, or COO matrix format', # <<<<<<<<<<<<<<
24813 : * SparseEfficiencyWarning)
24814 : * graph = csr_array(graph)
24815 : */
24816 0 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
24817 0 : __Pyx_GOTREF(__pyx_t_2);
24818 :
24819 : /* "scipy/sparse/csgraph/_reordering.pyx":243
24820 : * if graph.format not in ("csc", "coo"):
24821 : * warn('Input matrix should be in CSC, CSR, or COO matrix format',
24822 : * SparseEfficiencyWarning) # <<<<<<<<<<<<<<
24823 : * graph = csr_array(graph)
24824 : * # If A is a tall matrix, then transpose.
24825 : */
24826 0 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SparseEfficiencyWarning); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error)
24827 0 : __Pyx_GOTREF(__pyx_t_3);
24828 0 : __pyx_t_7 = NULL;
24829 0 : __pyx_t_4 = 0;
24830 : #if CYTHON_UNPACK_METHODS
24831 0 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
24832 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
24833 0 : if (likely(__pyx_t_7)) {
24834 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
24835 0 : __Pyx_INCREF(__pyx_t_7);
24836 0 : __Pyx_INCREF(function);
24837 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
24838 : __pyx_t_4 = 1;
24839 : }
24840 : }
24841 : #endif
24842 : {
24843 0 : PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_kp_u_Input_matrix_should_be_in_CSC_CS, __pyx_t_3};
24844 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
24845 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
24846 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24847 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
24848 0 : __Pyx_GOTREF(__pyx_t_1);
24849 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24850 : }
24851 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24852 :
24853 : /* "scipy/sparse/csgraph/_reordering.pyx":241
24854 : * raise TypeError('Input must be sparse')
24855 : * if graph.format != "csr":
24856 : * if graph.format not in ("csc", "coo"): # <<<<<<<<<<<<<<
24857 : * warn('Input matrix should be in CSC, CSR, or COO matrix format',
24858 : * SparseEfficiencyWarning)
24859 : */
24860 : }
24861 :
24862 : /* "scipy/sparse/csgraph/_reordering.pyx":244
24863 : * warn('Input matrix should be in CSC, CSR, or COO matrix format',
24864 : * SparseEfficiencyWarning)
24865 : * graph = csr_array(graph) # <<<<<<<<<<<<<<
24866 : * # If A is a tall matrix, then transpose.
24867 : * if graph.shape[0] > graph.shape[1]:
24868 : */
24869 3 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_csr_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error)
24870 3 : __Pyx_GOTREF(__pyx_t_2);
24871 3 : __pyx_t_3 = NULL;
24872 3 : __pyx_t_4 = 0;
24873 : #if CYTHON_UNPACK_METHODS
24874 3 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
24875 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
24876 0 : if (likely(__pyx_t_3)) {
24877 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
24878 0 : __Pyx_INCREF(__pyx_t_3);
24879 0 : __Pyx_INCREF(function);
24880 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
24881 : __pyx_t_4 = 1;
24882 : }
24883 : }
24884 : #endif
24885 : {
24886 3 : PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_graph};
24887 3 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
24888 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
24889 3 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error)
24890 3 : __Pyx_GOTREF(__pyx_t_1);
24891 3 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24892 : }
24893 3 : __Pyx_DECREF_SET(__pyx_v_graph, __pyx_t_1);
24894 4 : __pyx_t_1 = 0;
24895 :
24896 : /* "scipy/sparse/csgraph/_reordering.pyx":240
24897 : * if not issparse(graph):
24898 : * raise TypeError('Input must be sparse')
24899 : * if graph.format != "csr": # <<<<<<<<<<<<<<
24900 : * if graph.format not in ("csc", "coo"):
24901 : * warn('Input matrix should be in CSC, CSR, or COO matrix format',
24902 : */
24903 : }
24904 :
24905 : /* "scipy/sparse/csgraph/_reordering.pyx":246
24906 : * graph = csr_array(graph)
24907 : * # If A is a tall matrix, then transpose.
24908 : * if graph.shape[0] > graph.shape[1]: # <<<<<<<<<<<<<<
24909 : * graph = graph.T.tocsr()
24910 : * rank = np.sum(maximum_bipartite_matching(graph) >= 0)
24911 : */
24912 4 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
24913 4 : __Pyx_GOTREF(__pyx_t_1);
24914 4 : __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error)
24915 4 : __Pyx_GOTREF(__pyx_t_2);
24916 4 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24917 4 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
24918 4 : __Pyx_GOTREF(__pyx_t_1);
24919 4 : __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error)
24920 4 : __Pyx_GOTREF(__pyx_t_3);
24921 4 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24922 4 : __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
24923 4 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24924 4 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24925 4 : __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 246, __pyx_L1_error)
24926 4 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24927 4 : if (__pyx_t_5) {
24928 :
24929 : /* "scipy/sparse/csgraph/_reordering.pyx":247
24930 : * # If A is a tall matrix, then transpose.
24931 : * if graph.shape[0] > graph.shape[1]:
24932 : * graph = graph.T.tocsr() # <<<<<<<<<<<<<<
24933 : * rank = np.sum(maximum_bipartite_matching(graph) >= 0)
24934 : * return rank
24935 : */
24936 1 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_T); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 247, __pyx_L1_error)
24937 1 : __Pyx_GOTREF(__pyx_t_3);
24938 1 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tocsr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 247, __pyx_L1_error)
24939 1 : __Pyx_GOTREF(__pyx_t_2);
24940 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24941 1 : __pyx_t_3 = NULL;
24942 1 : __pyx_t_4 = 0;
24943 : #if CYTHON_UNPACK_METHODS
24944 1 : if (likely(PyMethod_Check(__pyx_t_2))) {
24945 1 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
24946 1 : if (likely(__pyx_t_3)) {
24947 1 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
24948 1 : __Pyx_INCREF(__pyx_t_3);
24949 1 : __Pyx_INCREF(function);
24950 1 : __Pyx_DECREF_SET(__pyx_t_2, function);
24951 : __pyx_t_4 = 1;
24952 : }
24953 : }
24954 : #endif
24955 : {
24956 1 : PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
24957 1 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
24958 1 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
24959 1 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
24960 1 : __Pyx_GOTREF(__pyx_t_1);
24961 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24962 : }
24963 1 : __Pyx_DECREF_SET(__pyx_v_graph, __pyx_t_1);
24964 : __pyx_t_1 = 0;
24965 :
24966 : /* "scipy/sparse/csgraph/_reordering.pyx":246
24967 : * graph = csr_array(graph)
24968 : * # If A is a tall matrix, then transpose.
24969 : * if graph.shape[0] > graph.shape[1]: # <<<<<<<<<<<<<<
24970 : * graph = graph.T.tocsr()
24971 : * rank = np.sum(maximum_bipartite_matching(graph) >= 0)
24972 : */
24973 : }
24974 :
24975 : /* "scipy/sparse/csgraph/_reordering.pyx":248
24976 : * if graph.shape[0] > graph.shape[1]:
24977 : * graph = graph.T.tocsr()
24978 : * rank = np.sum(maximum_bipartite_matching(graph) >= 0) # <<<<<<<<<<<<<<
24979 : * return rank
24980 : */
24981 4 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error)
24982 4 : __Pyx_GOTREF(__pyx_t_2);
24983 4 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
24984 4 : __Pyx_GOTREF(__pyx_t_3);
24985 4 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24986 4 : __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_maximum_bipartite_matching); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 248, __pyx_L1_error)
24987 4 : __Pyx_GOTREF(__pyx_t_7);
24988 4 : __pyx_t_8 = NULL;
24989 4 : __pyx_t_4 = 0;
24990 : #if CYTHON_UNPACK_METHODS
24991 4 : if (unlikely(PyMethod_Check(__pyx_t_7))) {
24992 0 : __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
24993 0 : if (likely(__pyx_t_8)) {
24994 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
24995 0 : __Pyx_INCREF(__pyx_t_8);
24996 0 : __Pyx_INCREF(function);
24997 0 : __Pyx_DECREF_SET(__pyx_t_7, function);
24998 : __pyx_t_4 = 1;
24999 : }
25000 : }
25001 : #endif
25002 : {
25003 4 : PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_graph};
25004 4 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
25005 4 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
25006 4 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error)
25007 4 : __Pyx_GOTREF(__pyx_t_2);
25008 4 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25009 : }
25010 4 : __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 248, __pyx_L1_error)
25011 4 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25012 4 : __pyx_t_2 = NULL;
25013 4 : __pyx_t_4 = 0;
25014 : #if CYTHON_UNPACK_METHODS
25015 4 : if (unlikely(PyMethod_Check(__pyx_t_3))) {
25016 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
25017 0 : if (likely(__pyx_t_2)) {
25018 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
25019 0 : __Pyx_INCREF(__pyx_t_2);
25020 0 : __Pyx_INCREF(function);
25021 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
25022 : __pyx_t_4 = 1;
25023 : }
25024 : }
25025 : #endif
25026 : {
25027 4 : PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7};
25028 4 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
25029 4 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
25030 4 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25031 4 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
25032 4 : __Pyx_GOTREF(__pyx_t_1);
25033 4 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25034 : }
25035 4 : __pyx_v_rank = __pyx_t_1;
25036 4 : __pyx_t_1 = 0;
25037 :
25038 : /* "scipy/sparse/csgraph/_reordering.pyx":249
25039 : * graph = graph.T.tocsr()
25040 : * rank = np.sum(maximum_bipartite_matching(graph) >= 0)
25041 : * return rank # <<<<<<<<<<<<<<
25042 : */
25043 4 : __Pyx_XDECREF(__pyx_r);
25044 4 : __Pyx_INCREF(__pyx_v_rank);
25045 4 : __pyx_r = __pyx_v_rank;
25046 4 : goto __pyx_L0;
25047 :
25048 : /* "scipy/sparse/csgraph/_reordering.pyx":177
25049 : *
25050 : *
25051 : * def structural_rank(graph): # <<<<<<<<<<<<<<
25052 : * """
25053 : * structural_rank(graph)
25054 : */
25055 :
25056 : /* function exit code */
25057 0 : __pyx_L1_error:;
25058 0 : __Pyx_XDECREF(__pyx_t_1);
25059 0 : __Pyx_XDECREF(__pyx_t_2);
25060 0 : __Pyx_XDECREF(__pyx_t_3);
25061 0 : __Pyx_XDECREF(__pyx_t_7);
25062 0 : __Pyx_XDECREF(__pyx_t_8);
25063 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._reordering.structural_rank", __pyx_clineno, __pyx_lineno, __pyx_filename);
25064 0 : __pyx_r = NULL;
25065 4 : __pyx_L0:;
25066 4 : __Pyx_XDECREF(__pyx_v_rank);
25067 4 : __Pyx_XDECREF(__pyx_v_graph);
25068 4 : __Pyx_XGIVEREF(__pyx_r);
25069 4 : __Pyx_RefNannyFinishContext();
25070 4 : return __pyx_r;
25071 : }
25072 : static struct __pyx_vtabstruct_array __pyx_vtable_array;
25073 :
25074 0 : static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
25075 0 : struct __pyx_array_obj *p;
25076 0 : PyObject *o;
25077 : #if CYTHON_COMPILING_IN_LIMITED_API
25078 : allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
25079 : o = alloc_func(t, 0);
25080 : #else
25081 0 : if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
25082 0 : o = (*t->tp_alloc)(t, 0);
25083 : } else {
25084 0 : o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
25085 : }
25086 0 : if (unlikely(!o)) return 0;
25087 : #endif
25088 0 : p = ((struct __pyx_array_obj *)o);
25089 0 : p->__pyx_vtab = __pyx_vtabptr_array;
25090 0 : p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
25091 0 : p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
25092 0 : if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
25093 : return o;
25094 0 : bad:
25095 0 : Py_DECREF(o); o = 0;
25096 : return NULL;
25097 : }
25098 :
25099 0 : static void __pyx_tp_dealloc_array(PyObject *o) {
25100 0 : struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
25101 : #if CYTHON_USE_TP_FINALIZE
25102 0 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
25103 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_array) {
25104 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
25105 : }
25106 : }
25107 : #endif
25108 : {
25109 0 : PyObject *etype, *eval, *etb;
25110 0 : PyErr_Fetch(&etype, &eval, &etb);
25111 0 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
25112 0 : __pyx_array___dealloc__(o);
25113 0 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
25114 0 : PyErr_Restore(etype, eval, etb);
25115 : }
25116 0 : Py_CLEAR(p->mode);
25117 0 : Py_CLEAR(p->_format);
25118 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
25119 0 : (*Py_TYPE(o)->tp_free)(o);
25120 : #else
25121 : {
25122 : freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
25123 : if (tp_free) tp_free(o);
25124 : }
25125 : #endif
25126 : }
25127 0 : static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
25128 0 : PyObject *r;
25129 0 : PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
25130 0 : r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
25131 0 : Py_DECREF(x);
25132 : return r;
25133 : }
25134 :
25135 0 : static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
25136 0 : if (v) {
25137 0 : return __pyx_array___setitem__(o, i, v);
25138 : }
25139 : else {
25140 0 : __Pyx_TypeName o_type_name;
25141 0 : o_type_name = __Pyx_PyType_GetName(Py_TYPE(o));
25142 0 : PyErr_Format(PyExc_NotImplementedError,
25143 : "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
25144 0 : __Pyx_DECREF_TypeName(o_type_name);
25145 0 : return -1;
25146 : }
25147 : }
25148 :
25149 0 : static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
25150 0 : PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
25151 0 : if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25152 0 : PyErr_Clear();
25153 0 : v = __pyx_array___getattr__(o, n);
25154 : }
25155 0 : return v;
25156 : }
25157 :
25158 0 : static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
25159 0 : return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
25160 : }
25161 :
25162 : static PyMethodDef __pyx_methods_array[] = {
25163 : {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
25164 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25165 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25166 : {0, 0, 0, 0}
25167 : };
25168 :
25169 : static struct PyGetSetDef __pyx_getsets_array[] = {
25170 : {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
25171 : {0, 0, 0, 0, 0}
25172 : };
25173 : #if CYTHON_USE_TYPE_SPECS
25174 : #if !CYTHON_COMPILING_IN_LIMITED_API
25175 :
25176 : static PyBufferProcs __pyx_tp_as_buffer_array = {
25177 : #if PY_MAJOR_VERSION < 3
25178 : 0, /*bf_getreadbuffer*/
25179 : #endif
25180 : #if PY_MAJOR_VERSION < 3
25181 : 0, /*bf_getwritebuffer*/
25182 : #endif
25183 : #if PY_MAJOR_VERSION < 3
25184 : 0, /*bf_getsegcount*/
25185 : #endif
25186 : #if PY_MAJOR_VERSION < 3
25187 : 0, /*bf_getcharbuffer*/
25188 : #endif
25189 : __pyx_array_getbuffer, /*bf_getbuffer*/
25190 : 0, /*bf_releasebuffer*/
25191 : };
25192 : #endif
25193 : static PyType_Slot __pyx_type___pyx_array_slots[] = {
25194 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc_array},
25195 : {Py_sq_length, (void *)__pyx_array___len__},
25196 : {Py_sq_item, (void *)__pyx_sq_item_array},
25197 : {Py_mp_length, (void *)__pyx_array___len__},
25198 : {Py_mp_subscript, (void *)__pyx_array___getitem__},
25199 : {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_array},
25200 : {Py_tp_getattro, (void *)__pyx_tp_getattro_array},
25201 : #if defined(Py_bf_getbuffer)
25202 : {Py_bf_getbuffer, (void *)__pyx_array_getbuffer},
25203 : #endif
25204 : {Py_tp_methods, (void *)__pyx_methods_array},
25205 : {Py_tp_getset, (void *)__pyx_getsets_array},
25206 : {Py_tp_new, (void *)__pyx_tp_new_array},
25207 : {0, 0},
25208 : };
25209 : static PyType_Spec __pyx_type___pyx_array_spec = {
25210 : "scipy.sparse.csgraph._reordering.array",
25211 : sizeof(struct __pyx_array_obj),
25212 : 0,
25213 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE,
25214 : __pyx_type___pyx_array_slots,
25215 : };
25216 : #else
25217 :
25218 : static PySequenceMethods __pyx_tp_as_sequence_array = {
25219 : __pyx_array___len__, /*sq_length*/
25220 : 0, /*sq_concat*/
25221 : 0, /*sq_repeat*/
25222 : __pyx_sq_item_array, /*sq_item*/
25223 : 0, /*sq_slice*/
25224 : 0, /*sq_ass_item*/
25225 : 0, /*sq_ass_slice*/
25226 : 0, /*sq_contains*/
25227 : 0, /*sq_inplace_concat*/
25228 : 0, /*sq_inplace_repeat*/
25229 : };
25230 :
25231 : static PyMappingMethods __pyx_tp_as_mapping_array = {
25232 : __pyx_array___len__, /*mp_length*/
25233 : __pyx_array___getitem__, /*mp_subscript*/
25234 : __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
25235 : };
25236 :
25237 : static PyBufferProcs __pyx_tp_as_buffer_array = {
25238 : #if PY_MAJOR_VERSION < 3
25239 : 0, /*bf_getreadbuffer*/
25240 : #endif
25241 : #if PY_MAJOR_VERSION < 3
25242 : 0, /*bf_getwritebuffer*/
25243 : #endif
25244 : #if PY_MAJOR_VERSION < 3
25245 : 0, /*bf_getsegcount*/
25246 : #endif
25247 : #if PY_MAJOR_VERSION < 3
25248 : 0, /*bf_getcharbuffer*/
25249 : #endif
25250 : __pyx_array_getbuffer, /*bf_getbuffer*/
25251 : 0, /*bf_releasebuffer*/
25252 : };
25253 :
25254 : static PyTypeObject __pyx_type___pyx_array = {
25255 : PyVarObject_HEAD_INIT(0, 0)
25256 : "scipy.sparse.csgraph._reordering.""array", /*tp_name*/
25257 : sizeof(struct __pyx_array_obj), /*tp_basicsize*/
25258 : 0, /*tp_itemsize*/
25259 : __pyx_tp_dealloc_array, /*tp_dealloc*/
25260 : #if PY_VERSION_HEX < 0x030800b4
25261 : 0, /*tp_print*/
25262 : #endif
25263 : #if PY_VERSION_HEX >= 0x030800b4
25264 : 0, /*tp_vectorcall_offset*/
25265 : #endif
25266 : 0, /*tp_getattr*/
25267 : 0, /*tp_setattr*/
25268 : #if PY_MAJOR_VERSION < 3
25269 : 0, /*tp_compare*/
25270 : #endif
25271 : #if PY_MAJOR_VERSION >= 3
25272 : 0, /*tp_as_async*/
25273 : #endif
25274 : 0, /*tp_repr*/
25275 : 0, /*tp_as_number*/
25276 : &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
25277 : &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
25278 : 0, /*tp_hash*/
25279 : 0, /*tp_call*/
25280 : 0, /*tp_str*/
25281 : __pyx_tp_getattro_array, /*tp_getattro*/
25282 : 0, /*tp_setattro*/
25283 : &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
25284 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
25285 : 0, /*tp_doc*/
25286 : 0, /*tp_traverse*/
25287 : 0, /*tp_clear*/
25288 : 0, /*tp_richcompare*/
25289 : 0, /*tp_weaklistoffset*/
25290 : 0, /*tp_iter*/
25291 : 0, /*tp_iternext*/
25292 : __pyx_methods_array, /*tp_methods*/
25293 : 0, /*tp_members*/
25294 : __pyx_getsets_array, /*tp_getset*/
25295 : 0, /*tp_base*/
25296 : 0, /*tp_dict*/
25297 : 0, /*tp_descr_get*/
25298 : 0, /*tp_descr_set*/
25299 : #if !CYTHON_USE_TYPE_SPECS
25300 : 0, /*tp_dictoffset*/
25301 : #endif
25302 : 0, /*tp_init*/
25303 : 0, /*tp_alloc*/
25304 : __pyx_tp_new_array, /*tp_new*/
25305 : 0, /*tp_free*/
25306 : 0, /*tp_is_gc*/
25307 : 0, /*tp_bases*/
25308 : 0, /*tp_mro*/
25309 : 0, /*tp_cache*/
25310 : 0, /*tp_subclasses*/
25311 : 0, /*tp_weaklist*/
25312 : 0, /*tp_del*/
25313 : 0, /*tp_version_tag*/
25314 : #if PY_VERSION_HEX >= 0x030400a1
25315 : #if CYTHON_USE_TP_FINALIZE
25316 : 0, /*tp_finalize*/
25317 : #else
25318 : NULL, /*tp_finalize*/
25319 : #endif
25320 : #endif
25321 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
25322 : 0, /*tp_vectorcall*/
25323 : #endif
25324 : #if __PYX_NEED_TP_PRINT_SLOT == 1
25325 : 0, /*tp_print*/
25326 : #endif
25327 : #if PY_VERSION_HEX >= 0x030C0000
25328 : 0, /*tp_watched*/
25329 : #endif
25330 : #if PY_VERSION_HEX >= 0x030d00A4
25331 : 0, /*tp_versions_used*/
25332 : #endif
25333 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
25334 : 0, /*tp_pypy_flags*/
25335 : #endif
25336 : };
25337 : #endif
25338 :
25339 15 : static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
25340 15 : struct __pyx_MemviewEnum_obj *p;
25341 15 : PyObject *o;
25342 : #if CYTHON_COMPILING_IN_LIMITED_API
25343 : allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
25344 : o = alloc_func(t, 0);
25345 : #else
25346 15 : if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
25347 15 : o = (*t->tp_alloc)(t, 0);
25348 : } else {
25349 0 : o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
25350 : }
25351 15 : if (unlikely(!o)) return 0;
25352 : #endif
25353 15 : p = ((struct __pyx_MemviewEnum_obj *)o);
25354 15 : p->name = Py_None; Py_INCREF(Py_None);
25355 : return o;
25356 : }
25357 :
25358 0 : static void __pyx_tp_dealloc_Enum(PyObject *o) {
25359 0 : struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
25360 : #if CYTHON_USE_TP_FINALIZE
25361 0 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
25362 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_Enum) {
25363 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
25364 : }
25365 : }
25366 : #endif
25367 0 : PyObject_GC_UnTrack(o);
25368 0 : Py_CLEAR(p->name);
25369 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
25370 0 : (*Py_TYPE(o)->tp_free)(o);
25371 : #else
25372 : {
25373 : freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
25374 : if (tp_free) tp_free(o);
25375 : }
25376 : #endif
25377 : }
25378 :
25379 725 : static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
25380 725 : int e;
25381 725 : struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
25382 725 : if (p->name) {
25383 725 : e = (*v)(p->name, a); if (e) return e;
25384 : }
25385 : return 0;
25386 : }
25387 :
25388 0 : static int __pyx_tp_clear_Enum(PyObject *o) {
25389 0 : PyObject* tmp;
25390 0 : struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
25391 0 : tmp = ((PyObject*)p->name);
25392 0 : p->name = Py_None; Py_INCREF(Py_None);
25393 0 : Py_XDECREF(tmp);
25394 0 : return 0;
25395 : }
25396 :
25397 0 : static PyObject *__pyx_specialmethod___pyx_MemviewEnum___repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
25398 0 : return __pyx_MemviewEnum___repr__(self);
25399 : }
25400 :
25401 : static PyMethodDef __pyx_methods_Enum[] = {
25402 : {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_MemviewEnum___repr__, METH_NOARGS|METH_COEXIST, 0},
25403 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25404 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25405 : {0, 0, 0, 0}
25406 : };
25407 : #if CYTHON_USE_TYPE_SPECS
25408 : static PyType_Slot __pyx_type___pyx_MemviewEnum_slots[] = {
25409 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc_Enum},
25410 : {Py_tp_repr, (void *)__pyx_MemviewEnum___repr__},
25411 : {Py_tp_traverse, (void *)__pyx_tp_traverse_Enum},
25412 : {Py_tp_clear, (void *)__pyx_tp_clear_Enum},
25413 : {Py_tp_methods, (void *)__pyx_methods_Enum},
25414 : {Py_tp_init, (void *)__pyx_MemviewEnum___init__},
25415 : {Py_tp_new, (void *)__pyx_tp_new_Enum},
25416 : {0, 0},
25417 : };
25418 : static PyType_Spec __pyx_type___pyx_MemviewEnum_spec = {
25419 : "scipy.sparse.csgraph._reordering.Enum",
25420 : sizeof(struct __pyx_MemviewEnum_obj),
25421 : 0,
25422 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
25423 : __pyx_type___pyx_MemviewEnum_slots,
25424 : };
25425 : #else
25426 :
25427 : static PyTypeObject __pyx_type___pyx_MemviewEnum = {
25428 : PyVarObject_HEAD_INIT(0, 0)
25429 : "scipy.sparse.csgraph._reordering.""Enum", /*tp_name*/
25430 : sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
25431 : 0, /*tp_itemsize*/
25432 : __pyx_tp_dealloc_Enum, /*tp_dealloc*/
25433 : #if PY_VERSION_HEX < 0x030800b4
25434 : 0, /*tp_print*/
25435 : #endif
25436 : #if PY_VERSION_HEX >= 0x030800b4
25437 : 0, /*tp_vectorcall_offset*/
25438 : #endif
25439 : 0, /*tp_getattr*/
25440 : 0, /*tp_setattr*/
25441 : #if PY_MAJOR_VERSION < 3
25442 : 0, /*tp_compare*/
25443 : #endif
25444 : #if PY_MAJOR_VERSION >= 3
25445 : 0, /*tp_as_async*/
25446 : #endif
25447 : __pyx_MemviewEnum___repr__, /*tp_repr*/
25448 : 0, /*tp_as_number*/
25449 : 0, /*tp_as_sequence*/
25450 : 0, /*tp_as_mapping*/
25451 : 0, /*tp_hash*/
25452 : 0, /*tp_call*/
25453 : 0, /*tp_str*/
25454 : 0, /*tp_getattro*/
25455 : 0, /*tp_setattro*/
25456 : 0, /*tp_as_buffer*/
25457 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
25458 : 0, /*tp_doc*/
25459 : __pyx_tp_traverse_Enum, /*tp_traverse*/
25460 : __pyx_tp_clear_Enum, /*tp_clear*/
25461 : 0, /*tp_richcompare*/
25462 : 0, /*tp_weaklistoffset*/
25463 : 0, /*tp_iter*/
25464 : 0, /*tp_iternext*/
25465 : __pyx_methods_Enum, /*tp_methods*/
25466 : 0, /*tp_members*/
25467 : 0, /*tp_getset*/
25468 : 0, /*tp_base*/
25469 : 0, /*tp_dict*/
25470 : 0, /*tp_descr_get*/
25471 : 0, /*tp_descr_set*/
25472 : #if !CYTHON_USE_TYPE_SPECS
25473 : 0, /*tp_dictoffset*/
25474 : #endif
25475 : __pyx_MemviewEnum___init__, /*tp_init*/
25476 : 0, /*tp_alloc*/
25477 : __pyx_tp_new_Enum, /*tp_new*/
25478 : 0, /*tp_free*/
25479 : 0, /*tp_is_gc*/
25480 : 0, /*tp_bases*/
25481 : 0, /*tp_mro*/
25482 : 0, /*tp_cache*/
25483 : 0, /*tp_subclasses*/
25484 : 0, /*tp_weaklist*/
25485 : 0, /*tp_del*/
25486 : 0, /*tp_version_tag*/
25487 : #if PY_VERSION_HEX >= 0x030400a1
25488 : #if CYTHON_USE_TP_FINALIZE
25489 : 0, /*tp_finalize*/
25490 : #else
25491 : NULL, /*tp_finalize*/
25492 : #endif
25493 : #endif
25494 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
25495 : 0, /*tp_vectorcall*/
25496 : #endif
25497 : #if __PYX_NEED_TP_PRINT_SLOT == 1
25498 : 0, /*tp_print*/
25499 : #endif
25500 : #if PY_VERSION_HEX >= 0x030C0000
25501 : 0, /*tp_watched*/
25502 : #endif
25503 : #if PY_VERSION_HEX >= 0x030d00A4
25504 : 0, /*tp_versions_used*/
25505 : #endif
25506 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
25507 : 0, /*tp_pypy_flags*/
25508 : #endif
25509 : };
25510 : #endif
25511 : static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
25512 :
25513 0 : static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
25514 0 : struct __pyx_memoryview_obj *p;
25515 0 : PyObject *o;
25516 : #if CYTHON_COMPILING_IN_LIMITED_API
25517 : allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
25518 : o = alloc_func(t, 0);
25519 : #else
25520 0 : if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
25521 0 : o = (*t->tp_alloc)(t, 0);
25522 : } else {
25523 0 : o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
25524 : }
25525 0 : if (unlikely(!o)) return 0;
25526 : #endif
25527 0 : p = ((struct __pyx_memoryview_obj *)o);
25528 0 : p->__pyx_vtab = __pyx_vtabptr_memoryview;
25529 0 : p->obj = Py_None; Py_INCREF(Py_None);
25530 0 : p->_size = Py_None; Py_INCREF(Py_None);
25531 0 : p->_array_interface = Py_None; Py_INCREF(Py_None);
25532 0 : p->view.obj = NULL;
25533 0 : if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
25534 : return o;
25535 0 : bad:
25536 0 : Py_DECREF(o); o = 0;
25537 : return NULL;
25538 : }
25539 :
25540 0 : static void __pyx_tp_dealloc_memoryview(PyObject *o) {
25541 0 : struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
25542 : #if CYTHON_USE_TP_FINALIZE
25543 0 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
25544 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_memoryview) {
25545 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
25546 : }
25547 : }
25548 : #endif
25549 0 : PyObject_GC_UnTrack(o);
25550 : {
25551 0 : PyObject *etype, *eval, *etb;
25552 0 : PyErr_Fetch(&etype, &eval, &etb);
25553 0 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
25554 0 : __pyx_memoryview___dealloc__(o);
25555 0 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
25556 0 : PyErr_Restore(etype, eval, etb);
25557 : }
25558 0 : Py_CLEAR(p->obj);
25559 0 : Py_CLEAR(p->_size);
25560 0 : Py_CLEAR(p->_array_interface);
25561 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
25562 0 : (*Py_TYPE(o)->tp_free)(o);
25563 : #else
25564 : {
25565 : freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
25566 : if (tp_free) tp_free(o);
25567 : }
25568 : #endif
25569 : }
25570 :
25571 0 : static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
25572 0 : int e;
25573 0 : struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
25574 0 : if (p->obj) {
25575 0 : e = (*v)(p->obj, a); if (e) return e;
25576 : }
25577 0 : if (p->_size) {
25578 0 : e = (*v)(p->_size, a); if (e) return e;
25579 : }
25580 0 : if (p->_array_interface) {
25581 0 : e = (*v)(p->_array_interface, a); if (e) return e;
25582 : }
25583 0 : if (p->view.obj) {
25584 0 : e = (*v)(p->view.obj, a); if (e) return e;
25585 : }
25586 : return 0;
25587 : }
25588 :
25589 0 : static int __pyx_tp_clear_memoryview(PyObject *o) {
25590 0 : PyObject* tmp;
25591 0 : struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
25592 0 : tmp = ((PyObject*)p->obj);
25593 0 : p->obj = Py_None; Py_INCREF(Py_None);
25594 0 : Py_XDECREF(tmp);
25595 0 : tmp = ((PyObject*)p->_size);
25596 0 : p->_size = Py_None; Py_INCREF(Py_None);
25597 0 : Py_XDECREF(tmp);
25598 0 : tmp = ((PyObject*)p->_array_interface);
25599 0 : p->_array_interface = Py_None; Py_INCREF(Py_None);
25600 0 : Py_XDECREF(tmp);
25601 0 : Py_CLEAR(p->view.obj);
25602 0 : return 0;
25603 : }
25604 0 : static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
25605 0 : PyObject *r;
25606 0 : PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
25607 0 : r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
25608 0 : Py_DECREF(x);
25609 : return r;
25610 : }
25611 :
25612 0 : static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
25613 0 : if (v) {
25614 0 : return __pyx_memoryview___setitem__(o, i, v);
25615 : }
25616 : else {
25617 0 : __Pyx_TypeName o_type_name;
25618 0 : o_type_name = __Pyx_PyType_GetName(Py_TYPE(o));
25619 0 : PyErr_Format(PyExc_NotImplementedError,
25620 : "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
25621 0 : __Pyx_DECREF_TypeName(o_type_name);
25622 0 : return -1;
25623 : }
25624 : }
25625 :
25626 0 : static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
25627 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
25628 : }
25629 :
25630 0 : static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
25631 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
25632 : }
25633 :
25634 0 : static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
25635 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
25636 : }
25637 :
25638 0 : static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
25639 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
25640 : }
25641 :
25642 0 : static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
25643 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
25644 : }
25645 :
25646 0 : static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
25647 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
25648 : }
25649 :
25650 0 : static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
25651 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
25652 : }
25653 :
25654 0 : static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
25655 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
25656 : }
25657 :
25658 0 : static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
25659 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
25660 : }
25661 :
25662 0 : static PyObject *__pyx_specialmethod___pyx_memoryview___repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
25663 0 : return __pyx_memoryview___repr__(self);
25664 : }
25665 :
25666 : static PyMethodDef __pyx_methods_memoryview[] = {
25667 : {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_memoryview___repr__, METH_NOARGS|METH_COEXIST, 0},
25668 : {"is_c_contig", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_c_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25669 : {"is_f_contig", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_f_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25670 : {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25671 : {"copy_fortran", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy_fortran, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25672 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25673 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25674 : {0, 0, 0, 0}
25675 : };
25676 :
25677 : static struct PyGetSetDef __pyx_getsets_memoryview[] = {
25678 : {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
25679 : {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
25680 : {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
25681 : {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
25682 : {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
25683 : {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
25684 : {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
25685 : {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
25686 : {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
25687 : {0, 0, 0, 0, 0}
25688 : };
25689 : #if CYTHON_USE_TYPE_SPECS
25690 : #if !CYTHON_COMPILING_IN_LIMITED_API
25691 :
25692 : static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
25693 : #if PY_MAJOR_VERSION < 3
25694 : 0, /*bf_getreadbuffer*/
25695 : #endif
25696 : #if PY_MAJOR_VERSION < 3
25697 : 0, /*bf_getwritebuffer*/
25698 : #endif
25699 : #if PY_MAJOR_VERSION < 3
25700 : 0, /*bf_getsegcount*/
25701 : #endif
25702 : #if PY_MAJOR_VERSION < 3
25703 : 0, /*bf_getcharbuffer*/
25704 : #endif
25705 : __pyx_memoryview_getbuffer, /*bf_getbuffer*/
25706 : 0, /*bf_releasebuffer*/
25707 : };
25708 : #endif
25709 : static PyType_Slot __pyx_type___pyx_memoryview_slots[] = {
25710 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc_memoryview},
25711 : {Py_tp_repr, (void *)__pyx_memoryview___repr__},
25712 : {Py_sq_length, (void *)__pyx_memoryview___len__},
25713 : {Py_sq_item, (void *)__pyx_sq_item_memoryview},
25714 : {Py_mp_length, (void *)__pyx_memoryview___len__},
25715 : {Py_mp_subscript, (void *)__pyx_memoryview___getitem__},
25716 : {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_memoryview},
25717 : {Py_tp_str, (void *)__pyx_memoryview___str__},
25718 : #if defined(Py_bf_getbuffer)
25719 : {Py_bf_getbuffer, (void *)__pyx_memoryview_getbuffer},
25720 : #endif
25721 : {Py_tp_traverse, (void *)__pyx_tp_traverse_memoryview},
25722 : {Py_tp_clear, (void *)__pyx_tp_clear_memoryview},
25723 : {Py_tp_methods, (void *)__pyx_methods_memoryview},
25724 : {Py_tp_getset, (void *)__pyx_getsets_memoryview},
25725 : {Py_tp_new, (void *)__pyx_tp_new_memoryview},
25726 : {0, 0},
25727 : };
25728 : static PyType_Spec __pyx_type___pyx_memoryview_spec = {
25729 : "scipy.sparse.csgraph._reordering.memoryview",
25730 : sizeof(struct __pyx_memoryview_obj),
25731 : 0,
25732 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
25733 : __pyx_type___pyx_memoryview_slots,
25734 : };
25735 : #else
25736 :
25737 : static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
25738 : __pyx_memoryview___len__, /*sq_length*/
25739 : 0, /*sq_concat*/
25740 : 0, /*sq_repeat*/
25741 : __pyx_sq_item_memoryview, /*sq_item*/
25742 : 0, /*sq_slice*/
25743 : 0, /*sq_ass_item*/
25744 : 0, /*sq_ass_slice*/
25745 : 0, /*sq_contains*/
25746 : 0, /*sq_inplace_concat*/
25747 : 0, /*sq_inplace_repeat*/
25748 : };
25749 :
25750 : static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
25751 : __pyx_memoryview___len__, /*mp_length*/
25752 : __pyx_memoryview___getitem__, /*mp_subscript*/
25753 : __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
25754 : };
25755 :
25756 : static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
25757 : #if PY_MAJOR_VERSION < 3
25758 : 0, /*bf_getreadbuffer*/
25759 : #endif
25760 : #if PY_MAJOR_VERSION < 3
25761 : 0, /*bf_getwritebuffer*/
25762 : #endif
25763 : #if PY_MAJOR_VERSION < 3
25764 : 0, /*bf_getsegcount*/
25765 : #endif
25766 : #if PY_MAJOR_VERSION < 3
25767 : 0, /*bf_getcharbuffer*/
25768 : #endif
25769 : __pyx_memoryview_getbuffer, /*bf_getbuffer*/
25770 : 0, /*bf_releasebuffer*/
25771 : };
25772 :
25773 : static PyTypeObject __pyx_type___pyx_memoryview = {
25774 : PyVarObject_HEAD_INIT(0, 0)
25775 : "scipy.sparse.csgraph._reordering.""memoryview", /*tp_name*/
25776 : sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
25777 : 0, /*tp_itemsize*/
25778 : __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
25779 : #if PY_VERSION_HEX < 0x030800b4
25780 : 0, /*tp_print*/
25781 : #endif
25782 : #if PY_VERSION_HEX >= 0x030800b4
25783 : 0, /*tp_vectorcall_offset*/
25784 : #endif
25785 : 0, /*tp_getattr*/
25786 : 0, /*tp_setattr*/
25787 : #if PY_MAJOR_VERSION < 3
25788 : 0, /*tp_compare*/
25789 : #endif
25790 : #if PY_MAJOR_VERSION >= 3
25791 : 0, /*tp_as_async*/
25792 : #endif
25793 : __pyx_memoryview___repr__, /*tp_repr*/
25794 : 0, /*tp_as_number*/
25795 : &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
25796 : &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
25797 : 0, /*tp_hash*/
25798 : 0, /*tp_call*/
25799 : __pyx_memoryview___str__, /*tp_str*/
25800 : 0, /*tp_getattro*/
25801 : 0, /*tp_setattro*/
25802 : &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
25803 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
25804 : 0, /*tp_doc*/
25805 : __pyx_tp_traverse_memoryview, /*tp_traverse*/
25806 : __pyx_tp_clear_memoryview, /*tp_clear*/
25807 : 0, /*tp_richcompare*/
25808 : 0, /*tp_weaklistoffset*/
25809 : 0, /*tp_iter*/
25810 : 0, /*tp_iternext*/
25811 : __pyx_methods_memoryview, /*tp_methods*/
25812 : 0, /*tp_members*/
25813 : __pyx_getsets_memoryview, /*tp_getset*/
25814 : 0, /*tp_base*/
25815 : 0, /*tp_dict*/
25816 : 0, /*tp_descr_get*/
25817 : 0, /*tp_descr_set*/
25818 : #if !CYTHON_USE_TYPE_SPECS
25819 : 0, /*tp_dictoffset*/
25820 : #endif
25821 : 0, /*tp_init*/
25822 : 0, /*tp_alloc*/
25823 : __pyx_tp_new_memoryview, /*tp_new*/
25824 : 0, /*tp_free*/
25825 : 0, /*tp_is_gc*/
25826 : 0, /*tp_bases*/
25827 : 0, /*tp_mro*/
25828 : 0, /*tp_cache*/
25829 : 0, /*tp_subclasses*/
25830 : 0, /*tp_weaklist*/
25831 : 0, /*tp_del*/
25832 : 0, /*tp_version_tag*/
25833 : #if PY_VERSION_HEX >= 0x030400a1
25834 : #if CYTHON_USE_TP_FINALIZE
25835 : 0, /*tp_finalize*/
25836 : #else
25837 : NULL, /*tp_finalize*/
25838 : #endif
25839 : #endif
25840 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
25841 : 0, /*tp_vectorcall*/
25842 : #endif
25843 : #if __PYX_NEED_TP_PRINT_SLOT == 1
25844 : 0, /*tp_print*/
25845 : #endif
25846 : #if PY_VERSION_HEX >= 0x030C0000
25847 : 0, /*tp_watched*/
25848 : #endif
25849 : #if PY_VERSION_HEX >= 0x030d00A4
25850 : 0, /*tp_versions_used*/
25851 : #endif
25852 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
25853 : 0, /*tp_pypy_flags*/
25854 : #endif
25855 : };
25856 : #endif
25857 : static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
25858 :
25859 0 : static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
25860 0 : struct __pyx_memoryviewslice_obj *p;
25861 0 : PyObject *o = __pyx_tp_new_memoryview(t, a, k);
25862 0 : if (unlikely(!o)) return 0;
25863 0 : p = ((struct __pyx_memoryviewslice_obj *)o);
25864 0 : p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
25865 0 : p->from_object = Py_None; Py_INCREF(Py_None);
25866 0 : p->from_slice.memview = NULL;
25867 0 : return o;
25868 : }
25869 :
25870 0 : static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
25871 0 : struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
25872 : #if CYTHON_USE_TP_FINALIZE
25873 0 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
25874 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc__memoryviewslice) {
25875 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
25876 : }
25877 : }
25878 : #endif
25879 0 : PyObject_GC_UnTrack(o);
25880 : {
25881 0 : PyObject *etype, *eval, *etb;
25882 0 : PyErr_Fetch(&etype, &eval, &etb);
25883 0 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
25884 0 : __pyx_memoryviewslice___dealloc__(o);
25885 0 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
25886 0 : PyErr_Restore(etype, eval, etb);
25887 : }
25888 0 : Py_CLEAR(p->from_object);
25889 0 : PyObject_GC_Track(o);
25890 0 : __pyx_tp_dealloc_memoryview(o);
25891 : }
25892 :
25893 0 : static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
25894 0 : int e;
25895 0 : struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
25896 0 : e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
25897 0 : if (p->from_object) {
25898 0 : e = (*v)(p->from_object, a); if (e) return e;
25899 : }
25900 : return 0;
25901 : }
25902 :
25903 0 : static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
25904 0 : PyObject* tmp;
25905 0 : struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
25906 0 : __pyx_tp_clear_memoryview(o);
25907 0 : tmp = ((PyObject*)p->from_object);
25908 0 : p->from_object = Py_None; Py_INCREF(Py_None);
25909 0 : Py_XDECREF(tmp);
25910 0 : __PYX_XCLEAR_MEMVIEW(&p->from_slice, 1);
25911 0 : return 0;
25912 : }
25913 :
25914 : static PyMethodDef __pyx_methods__memoryviewslice[] = {
25915 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25916 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25917 : {0, 0, 0, 0}
25918 : };
25919 : #if CYTHON_USE_TYPE_SPECS
25920 : static PyType_Slot __pyx_type___pyx_memoryviewslice_slots[] = {
25921 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc__memoryviewslice},
25922 : {Py_tp_doc, (void *)PyDoc_STR("Internal class for passing memoryview slices to Python")},
25923 : {Py_tp_traverse, (void *)__pyx_tp_traverse__memoryviewslice},
25924 : {Py_tp_clear, (void *)__pyx_tp_clear__memoryviewslice},
25925 : {Py_tp_methods, (void *)__pyx_methods__memoryviewslice},
25926 : {Py_tp_new, (void *)__pyx_tp_new__memoryviewslice},
25927 : {0, 0},
25928 : };
25929 : static PyType_Spec __pyx_type___pyx_memoryviewslice_spec = {
25930 : "scipy.sparse.csgraph._reordering._memoryviewslice",
25931 : sizeof(struct __pyx_memoryviewslice_obj),
25932 : 0,
25933 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE,
25934 : __pyx_type___pyx_memoryviewslice_slots,
25935 : };
25936 : #else
25937 :
25938 : static PyTypeObject __pyx_type___pyx_memoryviewslice = {
25939 : PyVarObject_HEAD_INIT(0, 0)
25940 : "scipy.sparse.csgraph._reordering.""_memoryviewslice", /*tp_name*/
25941 : sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
25942 : 0, /*tp_itemsize*/
25943 : __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
25944 : #if PY_VERSION_HEX < 0x030800b4
25945 : 0, /*tp_print*/
25946 : #endif
25947 : #if PY_VERSION_HEX >= 0x030800b4
25948 : 0, /*tp_vectorcall_offset*/
25949 : #endif
25950 : 0, /*tp_getattr*/
25951 : 0, /*tp_setattr*/
25952 : #if PY_MAJOR_VERSION < 3
25953 : 0, /*tp_compare*/
25954 : #endif
25955 : #if PY_MAJOR_VERSION >= 3
25956 : 0, /*tp_as_async*/
25957 : #endif
25958 : #if CYTHON_COMPILING_IN_PYPY || 0
25959 : __pyx_memoryview___repr__, /*tp_repr*/
25960 : #else
25961 : 0, /*tp_repr*/
25962 : #endif
25963 : 0, /*tp_as_number*/
25964 : 0, /*tp_as_sequence*/
25965 : 0, /*tp_as_mapping*/
25966 : 0, /*tp_hash*/
25967 : 0, /*tp_call*/
25968 : #if CYTHON_COMPILING_IN_PYPY || 0
25969 : __pyx_memoryview___str__, /*tp_str*/
25970 : #else
25971 : 0, /*tp_str*/
25972 : #endif
25973 : 0, /*tp_getattro*/
25974 : 0, /*tp_setattro*/
25975 : 0, /*tp_as_buffer*/
25976 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
25977 : PyDoc_STR("Internal class for passing memoryview slices to Python"), /*tp_doc*/
25978 : __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
25979 : __pyx_tp_clear__memoryviewslice, /*tp_clear*/
25980 : 0, /*tp_richcompare*/
25981 : 0, /*tp_weaklistoffset*/
25982 : 0, /*tp_iter*/
25983 : 0, /*tp_iternext*/
25984 : __pyx_methods__memoryviewslice, /*tp_methods*/
25985 : 0, /*tp_members*/
25986 : 0, /*tp_getset*/
25987 : 0, /*tp_base*/
25988 : 0, /*tp_dict*/
25989 : 0, /*tp_descr_get*/
25990 : 0, /*tp_descr_set*/
25991 : #if !CYTHON_USE_TYPE_SPECS
25992 : 0, /*tp_dictoffset*/
25993 : #endif
25994 : 0, /*tp_init*/
25995 : 0, /*tp_alloc*/
25996 : __pyx_tp_new__memoryviewslice, /*tp_new*/
25997 : 0, /*tp_free*/
25998 : 0, /*tp_is_gc*/
25999 : 0, /*tp_bases*/
26000 : 0, /*tp_mro*/
26001 : 0, /*tp_cache*/
26002 : 0, /*tp_subclasses*/
26003 : 0, /*tp_weaklist*/
26004 : 0, /*tp_del*/
26005 : 0, /*tp_version_tag*/
26006 : #if PY_VERSION_HEX >= 0x030400a1
26007 : #if CYTHON_USE_TP_FINALIZE
26008 : 0, /*tp_finalize*/
26009 : #else
26010 : NULL, /*tp_finalize*/
26011 : #endif
26012 : #endif
26013 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
26014 : 0, /*tp_vectorcall*/
26015 : #endif
26016 : #if __PYX_NEED_TP_PRINT_SLOT == 1
26017 : 0, /*tp_print*/
26018 : #endif
26019 : #if PY_VERSION_HEX >= 0x030C0000
26020 : 0, /*tp_watched*/
26021 : #endif
26022 : #if PY_VERSION_HEX >= 0x030d00A4
26023 : 0, /*tp_versions_used*/
26024 : #endif
26025 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
26026 : 0, /*tp_pypy_flags*/
26027 : #endif
26028 : };
26029 : #endif
26030 :
26031 : static PyMethodDef __pyx_methods[] = {
26032 : {0, 0, 0, 0}
26033 : };
26034 : #ifndef CYTHON_SMALL_CODE
26035 : #if defined(__clang__)
26036 : #define CYTHON_SMALL_CODE
26037 : #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
26038 : #define CYTHON_SMALL_CODE __attribute__((cold))
26039 : #else
26040 : #define CYTHON_SMALL_CODE
26041 : #endif
26042 : #endif
26043 : /* #### Code section: pystring_table ### */
26044 :
26045 3 : static int __Pyx_CreateStringTabAndInitStrings(void) {
26046 3 : __Pyx_StringTabEntry __pyx_string_tab[] = {
26047 3 : {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
26048 3 : {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
26049 3 : {&__pyx_kp_s_All_dimensions_preceding_dimensi, __pyx_k_All_dimensions_preceding_dimensi, sizeof(__pyx_k_All_dimensions_preceding_dimensi), 0, 0, 1, 0},
26050 3 : {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1},
26051 3 : {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
26052 3 : {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
26053 3 : {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
26054 3 : {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
26055 3 : {&__pyx_kp_u_Cannot_index_with_type, __pyx_k_Cannot_index_with_type, sizeof(__pyx_k_Cannot_index_with_type), 0, 1, 0, 0},
26056 3 : {&__pyx_kp_s_Cannot_transpose_memoryview_with, __pyx_k_Cannot_transpose_memoryview_with, sizeof(__pyx_k_Cannot_transpose_memoryview_with), 0, 0, 1, 0},
26057 3 : {&__pyx_n_s_DTYPE, __pyx_k_DTYPE, sizeof(__pyx_k_DTYPE), 0, 0, 1, 1},
26058 3 : {&__pyx_kp_s_Dimension_d_is_not_direct, __pyx_k_Dimension_d_is_not_direct, sizeof(__pyx_k_Dimension_d_is_not_direct), 0, 0, 1, 0},
26059 3 : {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
26060 3 : {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
26061 3 : {&__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_k_Expected_at_least_d_argument_s_g, sizeof(__pyx_k_Expected_at_least_d_argument_s_g), 0, 0, 1, 0},
26062 3 : {&__pyx_kp_s_Function_call_with_ambiguous_arg, __pyx_k_Function_call_with_ambiguous_arg, sizeof(__pyx_k_Function_call_with_ambiguous_arg), 0, 0, 1, 0},
26063 3 : {&__pyx_n_s_ITYPE, __pyx_k_ITYPE, sizeof(__pyx_k_ITYPE), 0, 0, 1, 1},
26064 3 : {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
26065 3 : {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
26066 3 : {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
26067 3 : {&__pyx_kp_s_Index_out_of_bounds_axis_d, __pyx_k_Index_out_of_bounds_axis_d, sizeof(__pyx_k_Index_out_of_bounds_axis_d), 0, 0, 1, 0},
26068 3 : {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
26069 3 : {&__pyx_kp_u_Input_graph_must_be_sparse, __pyx_k_Input_graph_must_be_sparse, sizeof(__pyx_k_Input_graph_must_be_sparse), 0, 1, 0, 0},
26070 3 : {&__pyx_kp_u_Input_matrix_should_be_in_CSC_CS, __pyx_k_Input_matrix_should_be_in_CSC_CS, sizeof(__pyx_k_Input_matrix_should_be_in_CSC_CS), 0, 1, 0, 0},
26071 3 : {&__pyx_kp_u_Input_must_be_in_CSC_or_CSR_spar, __pyx_k_Input_must_be_in_CSC_or_CSR_spar, sizeof(__pyx_k_Input_must_be_in_CSC_or_CSR_spar), 0, 1, 0, 0},
26072 3 : {&__pyx_kp_u_Input_must_be_sparse, __pyx_k_Input_must_be_sparse, sizeof(__pyx_k_Input_must_be_sparse), 0, 1, 0, 0},
26073 3 : {&__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 1, 0, 0},
26074 3 : {&__pyx_kp_u_Invalid_shape_in_axis, __pyx_k_Invalid_shape_in_axis, sizeof(__pyx_k_Invalid_shape_in_axis), 0, 1, 0, 0},
26075 3 : {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
26076 3 : {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
26077 3 : {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
26078 3 : {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1},
26079 3 : {&__pyx_n_s_N_old, __pyx_k_N_old, sizeof(__pyx_k_N_old), 0, 0, 1, 1},
26080 3 : {&__pyx_kp_s_No_matching_signature_found, __pyx_k_No_matching_signature_found, sizeof(__pyx_k_No_matching_signature_found), 0, 0, 1, 0},
26081 3 : {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
26082 3 : {&__pyx_kp_u_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 1, 0, 0},
26083 3 : {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
26084 3 : {&__pyx_n_s_Sequence, __pyx_k_Sequence, sizeof(__pyx_k_Sequence), 0, 0, 1, 1},
26085 3 : {&__pyx_n_s_SparseEfficiencyWarning, __pyx_k_SparseEfficiencyWarning, sizeof(__pyx_k_SparseEfficiencyWarning), 0, 0, 1, 1},
26086 3 : {&__pyx_kp_s_Step_may_not_be_zero_axis_d, __pyx_k_Step_may_not_be_zero_axis_d, sizeof(__pyx_k_Step_may_not_be_zero_axis_d), 0, 0, 1, 0},
26087 3 : {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1},
26088 3 : {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
26089 3 : {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
26090 3 : {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
26091 3 : {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
26092 3 : {&__pyx_kp_s__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 0, 1, 0},
26093 3 : {&__pyx_kp_s__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 0, 1, 0},
26094 3 : {&__pyx_kp_u__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0, 0},
26095 3 : {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
26096 3 : {&__pyx_n_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 1},
26097 3 : {&__pyx_n_s__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 0, 1, 1},
26098 3 : {&__pyx_n_s__38, __pyx_k__38, sizeof(__pyx_k__38), 0, 0, 1, 1},
26099 3 : {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0},
26100 3 : {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0},
26101 3 : {&__pyx_n_s_abc, __pyx_k_abc, sizeof(__pyx_k_abc), 0, 0, 1, 1},
26102 3 : {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
26103 3 : {&__pyx_kp_u_and, __pyx_k_and, sizeof(__pyx_k_and), 0, 1, 0, 0},
26104 3 : {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
26105 3 : {&__pyx_n_s_argsort, __pyx_k_argsort, sizeof(__pyx_k_argsort), 0, 0, 1, 1},
26106 3 : {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
26107 3 : {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
26108 3 : {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
26109 3 : {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
26110 3 : {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
26111 3 : {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1},
26112 3 : {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
26113 3 : {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
26114 3 : {&__pyx_kp_s_collections_abc, __pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 0, 1, 0},
26115 3 : {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
26116 3 : {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
26117 3 : {&__pyx_n_s_convert_pydata_sparse_to_scipy, __pyx_k_convert_pydata_sparse_to_scipy, sizeof(__pyx_k_convert_pydata_sparse_to_scipy), 0, 0, 1, 1},
26118 3 : {&__pyx_n_u_coo, __pyx_k_coo, sizeof(__pyx_k_coo), 0, 1, 0, 1},
26119 3 : {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
26120 3 : {&__pyx_n_u_csc, __pyx_k_csc, sizeof(__pyx_k_csc), 0, 1, 0, 1},
26121 3 : {&__pyx_n_u_csr, __pyx_k_csr, sizeof(__pyx_k_csr), 0, 1, 0, 1},
26122 3 : {&__pyx_n_s_csr_array, __pyx_k_csr_array, sizeof(__pyx_k_csr_array), 0, 0, 1, 1},
26123 3 : {&__pyx_n_s_defaults, __pyx_k_defaults, sizeof(__pyx_k_defaults), 0, 0, 1, 1},
26124 3 : {&__pyx_n_s_degree, __pyx_k_degree, sizeof(__pyx_k_degree), 0, 0, 1, 1},
26125 3 : {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
26126 3 : {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
26127 3 : {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
26128 3 : {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
26129 3 : {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
26130 3 : {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
26131 3 : {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
26132 3 : {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
26133 3 : {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
26134 3 : {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
26135 3 : {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
26136 3 : {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
26137 3 : {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
26138 3 : {&__pyx_n_s_fused_sigindex, __pyx_k_fused_sigindex, sizeof(__pyx_k_fused_sigindex), 0, 0, 1, 1},
26139 3 : {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
26140 3 : {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
26141 3 : {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
26142 3 : {&__pyx_kp_u_got, __pyx_k_got, sizeof(__pyx_k_got), 0, 1, 0, 0},
26143 3 : {&__pyx_kp_u_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 1, 0, 0},
26144 3 : {&__pyx_n_s_graph, __pyx_k_graph, sizeof(__pyx_k_graph), 0, 0, 1, 1},
26145 3 : {&__pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_k_home_czgdp18079_Quansight_scipy, sizeof(__pyx_k_home_czgdp18079_Quansight_scipy), 0, 0, 1, 0},
26146 3 : {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
26147 3 : {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
26148 3 : {&__pyx_n_s_ii, __pyx_k_ii, sizeof(__pyx_k_ii), 0, 0, 1, 1},
26149 3 : {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
26150 3 : {&__pyx_n_s_ind, __pyx_k_ind, sizeof(__pyx_k_ind), 0, 0, 1, 1},
26151 3 : {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
26152 3 : {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1},
26153 3 : {&__pyx_n_s_indptr, __pyx_k_indptr, sizeof(__pyx_k_indptr), 0, 0, 1, 1},
26154 3 : {&__pyx_n_s_inds, __pyx_k_inds, sizeof(__pyx_k_inds), 0, 0, 1, 1},
26155 3 : {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1},
26156 3 : {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
26157 3 : {&__pyx_n_s_int32_t, __pyx_k_int32_t, sizeof(__pyx_k_int32_t), 0, 0, 1, 1},
26158 3 : {&__pyx_n_s_int64_t, __pyx_k_int64_t, sizeof(__pyx_k_int64_t), 0, 0, 1, 1},
26159 3 : {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
26160 3 : {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
26161 3 : {&__pyx_n_s_issparse, __pyx_k_issparse, sizeof(__pyx_k_issparse), 0, 0, 1, 1},
26162 3 : {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
26163 3 : {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
26164 3 : {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
26165 3 : {&__pyx_n_s_jj, __pyx_k_jj, sizeof(__pyx_k_jj), 0, 0, 1, 1},
26166 3 : {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1},
26167 3 : {&__pyx_n_s_kk, __pyx_k_kk, sizeof(__pyx_k_kk), 0, 0, 1, 1},
26168 3 : {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
26169 3 : {&__pyx_n_s_level_end, __pyx_k_level_end, sizeof(__pyx_k_level_end), 0, 0, 1, 1},
26170 3 : {&__pyx_n_s_level_len, __pyx_k_level_len, sizeof(__pyx_k_level_len), 0, 0, 1, 1},
26171 3 : {&__pyx_n_s_level_start, __pyx_k_level_start, sizeof(__pyx_k_level_start), 0, 0, 1, 1},
26172 3 : {&__pyx_n_s_ll, __pyx_k_ll, sizeof(__pyx_k_ll), 0, 0, 1, 1},
26173 3 : {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
26174 3 : {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
26175 3 : {&__pyx_n_s_maximum_bipartite_matching, __pyx_k_maximum_bipartite_matching, sizeof(__pyx_k_maximum_bipartite_matching), 0, 0, 1, 1},
26176 3 : {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
26177 3 : {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
26178 3 : {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
26179 3 : {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
26180 3 : {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
26181 3 : {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
26182 3 : {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
26183 3 : {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
26184 3 : {&__pyx_n_s_nrows, __pyx_k_nrows, sizeof(__pyx_k_nrows), 0, 0, 1, 1},
26185 3 : {&__pyx_n_s_num_rows, __pyx_k_num_rows, sizeof(__pyx_k_num_rows), 0, 0, 1, 1},
26186 3 : {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
26187 3 : {&__pyx_kp_u_numpy__core_multiarray_failed_to, __pyx_k_numpy__core_multiarray_failed_to, sizeof(__pyx_k_numpy__core_multiarray_failed_to), 0, 1, 0, 0},
26188 3 : {&__pyx_kp_u_numpy__core_umath_failed_to_impo, __pyx_k_numpy__core_umath_failed_to_impo, sizeof(__pyx_k_numpy__core_umath_failed_to_impo), 0, 1, 0, 0},
26189 3 : {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
26190 3 : {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1},
26191 3 : {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
26192 3 : {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
26193 3 : {&__pyx_n_s_ptr, __pyx_k_ptr, sizeof(__pyx_k_ptr), 0, 0, 1, 1},
26194 3 : {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
26195 3 : {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
26196 3 : {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
26197 3 : {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
26198 3 : {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
26199 3 : {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
26200 3 : {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
26201 3 : {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
26202 3 : {&__pyx_n_s_rank, __pyx_k_rank, sizeof(__pyx_k_rank), 0, 0, 1, 1},
26203 3 : {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
26204 3 : {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
26205 3 : {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
26206 3 : {&__pyx_n_s_register, __pyx_k_register, sizeof(__pyx_k_register), 0, 0, 1, 1},
26207 3 : {&__pyx_n_s_rev_inds, __pyx_k_rev_inds, sizeof(__pyx_k_rev_inds), 0, 0, 1, 1},
26208 3 : {&__pyx_n_s_reverse_cuthill_mckee, __pyx_k_reverse_cuthill_mckee, sizeof(__pyx_k_reverse_cuthill_mckee), 0, 0, 1, 1},
26209 3 : {&__pyx_n_s_reverse_cuthill_mckee_2, __pyx_k_reverse_cuthill_mckee_2, sizeof(__pyx_k_reverse_cuthill_mckee_2), 0, 0, 1, 1},
26210 3 : {&__pyx_kp_u_reverse_cuthill_mckee_graph_sym, __pyx_k_reverse_cuthill_mckee_graph_sym, sizeof(__pyx_k_reverse_cuthill_mckee_graph_sym), 0, 1, 0, 0},
26211 3 : {&__pyx_kp_u_reverse_cuthill_mckee_line_16, __pyx_k_reverse_cuthill_mckee_line_16, sizeof(__pyx_k_reverse_cuthill_mckee_line_16), 0, 1, 0, 0},
26212 3 : {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
26213 3 : {&__pyx_n_s_scipy_sparse, __pyx_k_scipy_sparse, sizeof(__pyx_k_scipy_sparse), 0, 0, 1, 1},
26214 3 : {&__pyx_n_s_scipy_sparse__sputils, __pyx_k_scipy_sparse__sputils, sizeof(__pyx_k_scipy_sparse__sputils), 0, 0, 1, 1},
26215 3 : {&__pyx_n_s_scipy_sparse_csgraph__reordering, __pyx_k_scipy_sparse_csgraph__reordering, sizeof(__pyx_k_scipy_sparse_csgraph__reordering), 0, 0, 1, 1},
26216 3 : {&__pyx_n_s_seed, __pyx_k_seed, sizeof(__pyx_k_seed), 0, 0, 1, 1},
26217 3 : {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
26218 3 : {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
26219 3 : {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
26220 3 : {&__pyx_n_s_signatures, __pyx_k_signatures, sizeof(__pyx_k_signatures), 0, 0, 1, 1},
26221 3 : {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
26222 3 : {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
26223 3 : {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
26224 3 : {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
26225 3 : {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
26226 3 : {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
26227 3 : {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
26228 3 : {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
26229 3 : {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
26230 3 : {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
26231 3 : {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1},
26232 3 : {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
26233 3 : {&__pyx_n_s_structural_rank, __pyx_k_structural_rank, sizeof(__pyx_k_structural_rank), 0, 0, 1, 1},
26234 3 : {&__pyx_kp_u_structural_rank_graph_Compute_t, __pyx_k_structural_rank_graph_Compute_t, sizeof(__pyx_k_structural_rank_graph_Compute_t), 0, 1, 0, 0},
26235 3 : {&__pyx_kp_u_structural_rank_line_177, __pyx_k_structural_rank_line_177, sizeof(__pyx_k_structural_rank_line_177), 0, 1, 0, 0},
26236 3 : {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
26237 3 : {&__pyx_n_s_symmetric_mode, __pyx_k_symmetric_mode, sizeof(__pyx_k_symmetric_mode), 0, 0, 1, 1},
26238 3 : {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
26239 3 : {&__pyx_n_s_temp, __pyx_k_temp, sizeof(__pyx_k_temp), 0, 0, 1, 1},
26240 3 : {&__pyx_n_s_temp2, __pyx_k_temp2, sizeof(__pyx_k_temp2), 0, 0, 1, 1},
26241 3 : {&__pyx_n_s_temp_degrees, __pyx_k_temp_degrees, sizeof(__pyx_k_temp_degrees), 0, 0, 1, 1},
26242 3 : {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
26243 3 : {&__pyx_n_s_tocsr, __pyx_k_tocsr, sizeof(__pyx_k_tocsr), 0, 0, 1, 1},
26244 3 : {&__pyx_n_s_transpose, __pyx_k_transpose, sizeof(__pyx_k_transpose), 0, 0, 1, 1},
26245 3 : {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
26246 3 : {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
26247 3 : {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
26248 3 : {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
26249 3 : {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
26250 3 : {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1},
26251 3 : {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1},
26252 3 : {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
26253 3 : {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
26254 3 : {&__pyx_n_s_zz, __pyx_k_zz, sizeof(__pyx_k_zz), 0, 0, 1, 1},
26255 : {0, 0, 0, 0, 0, 0, 0}
26256 : };
26257 3 : return __Pyx_InitStrings(__pyx_string_tab);
26258 : }
26259 : /* #### Code section: cached_builtins ### */
26260 3 : static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
26261 3 : __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 77, __pyx_L1_error)
26262 3 : __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 97, __pyx_L1_error)
26263 3 : __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 107, __pyx_L1_error)
26264 3 : __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(1, 100, __pyx_L1_error)
26265 3 : __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 156, __pyx_L1_error)
26266 3 : __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 159, __pyx_L1_error)
26267 3 : __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(1, 373, __pyx_L1_error)
26268 3 : __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 408, __pyx_L1_error)
26269 3 : __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 618, __pyx_L1_error)
26270 3 : __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 914, __pyx_L1_error)
26271 3 : __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1025, __pyx_L1_error)
26272 : return 0;
26273 : __pyx_L1_error:;
26274 : return -1;
26275 : }
26276 : /* #### Code section: cached_constants ### */
26277 :
26278 3 : static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
26279 : __Pyx_RefNannyDeclarations
26280 3 : __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
26281 :
26282 : /* "View.MemoryView":582
26283 : * def suboffsets(self):
26284 : * if self.view.suboffsets == NULL:
26285 : * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
26286 : *
26287 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
26288 : */
26289 3 : __pyx_tuple__4 = PyTuple_New(1); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 582, __pyx_L1_error)
26290 3 : __Pyx_GOTREF(__pyx_tuple__4);
26291 3 : __Pyx_INCREF(__pyx_int_neg_1);
26292 3 : __Pyx_GIVEREF(__pyx_int_neg_1);
26293 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_tuple__4, 0, __pyx_int_neg_1)) __PYX_ERR(1, 582, __pyx_L1_error);
26294 3 : __Pyx_GIVEREF(__pyx_tuple__4);
26295 :
26296 : /* "View.MemoryView":679
26297 : * tup = <tuple>index if isinstance(index, tuple) else (index,)
26298 : *
26299 : * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
26300 : * have_slices = False
26301 : * seen_ellipsis = False
26302 : */
26303 3 : __pyx_slice__5 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(1, 679, __pyx_L1_error)
26304 3 : __Pyx_GOTREF(__pyx_slice__5);
26305 3 : __Pyx_GIVEREF(__pyx_slice__5);
26306 :
26307 : /* "(tree fragment)":4
26308 : * cdef object __pyx_PickleError
26309 : * cdef object __pyx_result
26310 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<<
26311 : * from pickle import PickleError as __pyx_PickleError
26312 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
26313 : */
26314 3 : __pyx_tuple__8 = PyTuple_Pack(3, __pyx_int_136983863, __pyx_int_112105877, __pyx_int_184977713); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 4, __pyx_L1_error)
26315 3 : __Pyx_GOTREF(__pyx_tuple__8);
26316 3 : __Pyx_GIVEREF(__pyx_tuple__8);
26317 :
26318 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1025
26319 : * __pyx_import_array()
26320 : * except Exception:
26321 : * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
26322 : *
26323 : * cdef inline int import_umath() except -1:
26324 : */
26325 3 : __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_numpy__core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 1025, __pyx_L1_error)
26326 3 : __Pyx_GOTREF(__pyx_tuple__9);
26327 3 : __Pyx_GIVEREF(__pyx_tuple__9);
26328 :
26329 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1031
26330 : * _import_umath()
26331 : * except Exception:
26332 : * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
26333 : *
26334 : * cdef inline int import_ufunc() except -1:
26335 : */
26336 3 : __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_numpy__core_umath_failed_to_impo); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 1031, __pyx_L1_error)
26337 3 : __Pyx_GOTREF(__pyx_tuple__10);
26338 3 : __Pyx_GIVEREF(__pyx_tuple__10);
26339 :
26340 : /* "scipy/sparse/csgraph/_reordering.pyx":77
26341 : * graph = convert_pydata_sparse_to_scipy(graph)
26342 : * if not issparse(graph):
26343 : * raise TypeError("Input graph must be sparse") # <<<<<<<<<<<<<<
26344 : * if graph.format not in ("csc", "csr"):
26345 : * raise TypeError('Input must be in CSC or CSR sparse format.')
26346 : */
26347 3 : __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Input_graph_must_be_sparse); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 77, __pyx_L1_error)
26348 3 : __Pyx_GOTREF(__pyx_tuple__11);
26349 3 : __Pyx_GIVEREF(__pyx_tuple__11);
26350 :
26351 : /* "scipy/sparse/csgraph/_reordering.pyx":79
26352 : * raise TypeError("Input graph must be sparse")
26353 : * if graph.format not in ("csc", "csr"):
26354 : * raise TypeError('Input must be in CSC or CSR sparse format.') # <<<<<<<<<<<<<<
26355 : * nrows = graph.shape[0]
26356 : * if not symmetric_mode:
26357 : */
26358 3 : __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Input_must_be_in_CSC_or_CSR_spar); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 79, __pyx_L1_error)
26359 3 : __Pyx_GOTREF(__pyx_tuple__12);
26360 3 : __Pyx_GIVEREF(__pyx_tuple__12);
26361 :
26362 : /* "scipy/sparse/csgraph/_reordering.pyx":107
26363 : *
26364 : *
26365 : * def _reverse_cuthill_mckee(np.ndarray[int32_or_int64, ndim=1, mode="c"] ind, # <<<<<<<<<<<<<<
26366 : * np.ndarray[int32_or_int64, ndim=1, mode="c"] ptr,
26367 : * np.npy_intp num_rows):
26368 : */
26369 3 : __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 107, __pyx_L1_error)
26370 3 : __Pyx_GOTREF(__pyx_tuple__15);
26371 3 : __Pyx_GIVEREF(__pyx_tuple__15);
26372 3 : __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 107, __pyx_L1_error)
26373 3 : __Pyx_GOTREF(__pyx_tuple__16);
26374 3 : __Pyx_GIVEREF(__pyx_tuple__16);
26375 :
26376 : /* "scipy/sparse/csgraph/_reordering.pyx":174
26377 : *
26378 : * # return reversed order for RCM ordering
26379 : * return order[::-1] # <<<<<<<<<<<<<<
26380 : *
26381 : *
26382 : */
26383 3 : __pyx_slice__17 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__17)) __PYX_ERR(0, 174, __pyx_L1_error)
26384 3 : __Pyx_GOTREF(__pyx_slice__17);
26385 3 : __Pyx_GIVEREF(__pyx_slice__17);
26386 :
26387 : /* "scipy/sparse/csgraph/_reordering.pyx":239
26388 : * graph = convert_pydata_sparse_to_scipy(graph)
26389 : * if not issparse(graph):
26390 : * raise TypeError('Input must be sparse') # <<<<<<<<<<<<<<
26391 : * if graph.format != "csr":
26392 : * if graph.format not in ("csc", "coo"):
26393 : */
26394 3 : __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_Input_must_be_sparse); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 239, __pyx_L1_error)
26395 3 : __Pyx_GOTREF(__pyx_tuple__18);
26396 3 : __Pyx_GIVEREF(__pyx_tuple__18);
26397 :
26398 : /* "View.MemoryView":100
26399 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
26400 : * try:
26401 : * if __import__("sys").version_info >= (3, 3): # <<<<<<<<<<<<<<
26402 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
26403 : * else:
26404 : */
26405 3 : __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 100, __pyx_L1_error)
26406 3 : __Pyx_GOTREF(__pyx_tuple__19);
26407 3 : __Pyx_GIVEREF(__pyx_tuple__19);
26408 3 : __pyx_tuple__20 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_3); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 100, __pyx_L1_error)
26409 3 : __Pyx_GOTREF(__pyx_tuple__20);
26410 3 : __Pyx_GIVEREF(__pyx_tuple__20);
26411 :
26412 : /* "View.MemoryView":101
26413 : * try:
26414 : * if __import__("sys").version_info >= (3, 3):
26415 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence # <<<<<<<<<<<<<<
26416 : * else:
26417 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence
26418 : */
26419 3 : __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_collections_abc); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 101, __pyx_L1_error)
26420 3 : __Pyx_GOTREF(__pyx_tuple__21);
26421 3 : __Pyx_GIVEREF(__pyx_tuple__21);
26422 :
26423 : /* "View.MemoryView":103
26424 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
26425 : * else:
26426 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence # <<<<<<<<<<<<<<
26427 : * except:
26428 : *
26429 : */
26430 3 : __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_collections); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 103, __pyx_L1_error)
26431 3 : __Pyx_GOTREF(__pyx_tuple__22);
26432 3 : __Pyx_GIVEREF(__pyx_tuple__22);
26433 :
26434 : /* "View.MemoryView":309
26435 : * return self.name
26436 : *
26437 : * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
26438 : * cdef strided = Enum("<strided and direct>") # default
26439 : * cdef indirect = Enum("<strided and indirect>")
26440 : */
26441 3 : __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 309, __pyx_L1_error)
26442 3 : __Pyx_GOTREF(__pyx_tuple__23);
26443 3 : __Pyx_GIVEREF(__pyx_tuple__23);
26444 :
26445 : /* "View.MemoryView":310
26446 : *
26447 : * cdef generic = Enum("<strided and direct or indirect>")
26448 : * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
26449 : * cdef indirect = Enum("<strided and indirect>")
26450 : *
26451 : */
26452 3 : __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 310, __pyx_L1_error)
26453 3 : __Pyx_GOTREF(__pyx_tuple__24);
26454 3 : __Pyx_GIVEREF(__pyx_tuple__24);
26455 :
26456 : /* "View.MemoryView":311
26457 : * cdef generic = Enum("<strided and direct or indirect>")
26458 : * cdef strided = Enum("<strided and direct>") # default
26459 : * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
26460 : *
26461 : *
26462 : */
26463 3 : __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 311, __pyx_L1_error)
26464 3 : __Pyx_GOTREF(__pyx_tuple__25);
26465 3 : __Pyx_GIVEREF(__pyx_tuple__25);
26466 :
26467 : /* "View.MemoryView":314
26468 : *
26469 : *
26470 : * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
26471 : * cdef indirect_contiguous = Enum("<contiguous and indirect>")
26472 : *
26473 : */
26474 3 : __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 314, __pyx_L1_error)
26475 3 : __Pyx_GOTREF(__pyx_tuple__26);
26476 3 : __Pyx_GIVEREF(__pyx_tuple__26);
26477 :
26478 : /* "View.MemoryView":315
26479 : *
26480 : * cdef contiguous = Enum("<contiguous and direct>")
26481 : * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
26482 : *
26483 : *
26484 : */
26485 3 : __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 315, __pyx_L1_error)
26486 3 : __Pyx_GOTREF(__pyx_tuple__27);
26487 3 : __Pyx_GIVEREF(__pyx_tuple__27);
26488 :
26489 : /* "(tree fragment)":1
26490 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
26491 : * cdef object __pyx_PickleError
26492 : * cdef object __pyx_result
26493 : */
26494 3 : __pyx_tuple__28 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 1, __pyx_L1_error)
26495 3 : __Pyx_GOTREF(__pyx_tuple__28);
26496 3 : __Pyx_GIVEREF(__pyx_tuple__28);
26497 3 : __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(1, 1, __pyx_L1_error)
26498 :
26499 : /* "scipy/sparse/csgraph/_reordering.pyx":16
26500 : * include 'parameters.pxi'
26501 : *
26502 : * def reverse_cuthill_mckee(graph, symmetric_mode=False): # <<<<<<<<<<<<<<
26503 : * """
26504 : * reverse_cuthill_mckee(graph, symmetric_mode=False)
26505 : */
26506 3 : __pyx_tuple__31 = PyTuple_Pack(3, __pyx_n_s_graph, __pyx_n_s_symmetric_mode, __pyx_n_s_nrows); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 16, __pyx_L1_error)
26507 3 : __Pyx_GOTREF(__pyx_tuple__31);
26508 3 : __Pyx_GIVEREF(__pyx_tuple__31);
26509 3 : __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_reverse_cuthill_mckee_2, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 16, __pyx_L1_error)
26510 3 : __pyx_tuple__33 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 16, __pyx_L1_error)
26511 3 : __Pyx_GOTREF(__pyx_tuple__33);
26512 3 : __Pyx_GIVEREF(__pyx_tuple__33);
26513 :
26514 : /* "scipy/sparse/csgraph/_reordering.pyx":107
26515 : *
26516 : *
26517 : * def _reverse_cuthill_mckee(np.ndarray[int32_or_int64, ndim=1, mode="c"] ind, # <<<<<<<<<<<<<<
26518 : * np.ndarray[int32_or_int64, ndim=1, mode="c"] ptr,
26519 : * np.npy_intp num_rows):
26520 : */
26521 3 : __pyx_tuple__34 = PyTuple_Pack(23, __pyx_n_s_ind, __pyx_n_s_ptr, __pyx_n_s_num_rows, __pyx_n_s_N, __pyx_n_s_N_old, __pyx_n_s_level_start, __pyx_n_s_level_end, __pyx_n_s_temp, __pyx_n_s_zz, __pyx_n_s_ii, __pyx_n_s_jj, __pyx_n_s_kk, __pyx_n_s_ll, __pyx_n_s_level_len, __pyx_n_s_order, __pyx_n_s_degree, __pyx_n_s_inds, __pyx_n_s_rev_inds, __pyx_n_s_temp_degrees, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_seed, __pyx_n_s_temp2); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 107, __pyx_L1_error)
26522 3 : __Pyx_GOTREF(__pyx_tuple__34);
26523 3 : __Pyx_GIVEREF(__pyx_tuple__34);
26524 3 : __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 23, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_reverse_cuthill_mckee, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 107, __pyx_L1_error)
26525 :
26526 : /* "scipy/sparse/csgraph/_reordering.pyx":177
26527 : *
26528 : *
26529 : * def structural_rank(graph): # <<<<<<<<<<<<<<
26530 : * """
26531 : * structural_rank(graph)
26532 : */
26533 3 : __pyx_tuple__36 = PyTuple_Pack(2, __pyx_n_s_graph, __pyx_n_s_rank); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 177, __pyx_L1_error)
26534 3 : __Pyx_GOTREF(__pyx_tuple__36);
26535 3 : __Pyx_GIVEREF(__pyx_tuple__36);
26536 3 : __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_structural_rank, 177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 177, __pyx_L1_error)
26537 : __Pyx_RefNannyFinishContext();
26538 : return 0;
26539 : __pyx_L1_error:;
26540 : __Pyx_RefNannyFinishContext();
26541 : return -1;
26542 : }
26543 : /* #### Code section: init_constants ### */
26544 :
26545 3 : static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
26546 3 : __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
26547 3 : __pyx_umethod_PyDict_Type_get.method_name = &__pyx_n_s_get;
26548 3 : __pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
26549 3 : __pyx_umethod_PyDict_Type_values.method_name = &__pyx_n_s_values;
26550 3 : if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error);
26551 3 : __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
26552 3 : __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
26553 3 : __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
26554 3 : __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
26555 3 : __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
26556 3 : __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
26557 3 : __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
26558 : return 0;
26559 : __pyx_L1_error:;
26560 : return -1;
26561 : }
26562 : /* #### Code section: init_globals ### */
26563 :
26564 3 : static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
26565 : /* AssertionsEnabled.init */
26566 3 : if (likely(__Pyx_init_assertions_enabled() == 0)); else
26567 :
26568 0 : if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
26569 :
26570 : return 0;
26571 0 : __pyx_L1_error:;
26572 0 : return -1;
26573 : }
26574 : /* #### Code section: init_module ### */
26575 :
26576 : static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
26577 : static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
26578 : static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
26579 : static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
26580 : static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
26581 : static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
26582 : static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
26583 :
26584 3 : static int __Pyx_modinit_global_init_code(void) {
26585 : __Pyx_RefNannyDeclarations
26586 3 : __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
26587 : /*--- Global init code ---*/
26588 3 : __pyx_collections_abc_Sequence = Py_None; Py_INCREF(Py_None);
26589 3 : generic = Py_None; Py_INCREF(Py_None);
26590 3 : strided = Py_None; Py_INCREF(Py_None);
26591 3 : indirect = Py_None; Py_INCREF(Py_None);
26592 3 : contiguous = Py_None; Py_INCREF(Py_None);
26593 3 : indirect_contiguous = Py_None; Py_INCREF(Py_None);
26594 3 : __Pyx_RefNannyFinishContext();
26595 3 : return 0;
26596 : }
26597 :
26598 : static int __Pyx_modinit_variable_export_code(void) {
26599 : __Pyx_RefNannyDeclarations
26600 : __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
26601 : /*--- Variable export code ---*/
26602 : __Pyx_RefNannyFinishContext();
26603 : return 0;
26604 : }
26605 :
26606 : static int __Pyx_modinit_function_export_code(void) {
26607 : __Pyx_RefNannyDeclarations
26608 : __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
26609 : /*--- Function export code ---*/
26610 : __Pyx_RefNannyFinishContext();
26611 : return 0;
26612 : }
26613 :
26614 3 : static int __Pyx_modinit_type_init_code(void) {
26615 : __Pyx_RefNannyDeclarations
26616 3 : PyObject *__pyx_t_1 = NULL;
26617 3 : int __pyx_lineno = 0;
26618 3 : const char *__pyx_filename = NULL;
26619 3 : int __pyx_clineno = 0;
26620 3 : __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
26621 : /*--- Type init code ---*/
26622 3 : __pyx_vtabptr_array = &__pyx_vtable_array;
26623 3 : __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
26624 : #if CYTHON_USE_TYPE_SPECS
26625 : __pyx_array_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_array_spec, NULL); if (unlikely(!__pyx_array_type)) __PYX_ERR(1, 114, __pyx_L1_error)
26626 : #if !CYTHON_COMPILING_IN_LIMITED_API
26627 : __pyx_array_type->tp_as_buffer = &__pyx_tp_as_buffer_array;
26628 : if (!__pyx_array_type->tp_as_buffer->bf_releasebuffer && __pyx_array_type->tp_base->tp_as_buffer && __pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer) {
26629 : __pyx_array_type->tp_as_buffer->bf_releasebuffer = __pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer;
26630 : }
26631 : #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
26632 : /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
26633 : #elif defined(_MSC_VER)
26634 : #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
26635 : #else
26636 : #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
26637 : #endif
26638 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_array_spec, __pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
26639 : #else
26640 3 : __pyx_array_type = &__pyx_type___pyx_array;
26641 : #endif
26642 : #if !CYTHON_COMPILING_IN_LIMITED_API
26643 : #endif
26644 : #if !CYTHON_USE_TYPE_SPECS
26645 3 : if (__Pyx_PyType_Ready(__pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
26646 : #endif
26647 : #if PY_MAJOR_VERSION < 3
26648 : __pyx_array_type->tp_print = 0;
26649 : #endif
26650 3 : if (__Pyx_SetVtable(__pyx_array_type, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
26651 : #if !CYTHON_COMPILING_IN_LIMITED_API
26652 3 : if (__Pyx_MergeVtables(__pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
26653 : #endif
26654 : #if !CYTHON_COMPILING_IN_LIMITED_API
26655 3 : if (__Pyx_setup_reduce((PyObject *) __pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
26656 : #endif
26657 : #if CYTHON_USE_TYPE_SPECS
26658 : __pyx_MemviewEnum_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_MemviewEnum_spec, NULL); if (unlikely(!__pyx_MemviewEnum_type)) __PYX_ERR(1, 302, __pyx_L1_error)
26659 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_MemviewEnum_spec, __pyx_MemviewEnum_type) < 0) __PYX_ERR(1, 302, __pyx_L1_error)
26660 : #else
26661 3 : __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
26662 : #endif
26663 : #if !CYTHON_COMPILING_IN_LIMITED_API
26664 : #endif
26665 : #if !CYTHON_USE_TYPE_SPECS
26666 3 : if (__Pyx_PyType_Ready(__pyx_MemviewEnum_type) < 0) __PYX_ERR(1, 302, __pyx_L1_error)
26667 : #endif
26668 : #if PY_MAJOR_VERSION < 3
26669 : __pyx_MemviewEnum_type->tp_print = 0;
26670 : #endif
26671 : #if !CYTHON_COMPILING_IN_LIMITED_API
26672 3 : if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_MemviewEnum_type->tp_dictoffset && __pyx_MemviewEnum_type->tp_getattro == PyObject_GenericGetAttr)) {
26673 3 : __pyx_MemviewEnum_type->tp_getattro = __Pyx_PyObject_GenericGetAttr;
26674 : }
26675 : #endif
26676 : #if !CYTHON_COMPILING_IN_LIMITED_API
26677 3 : if (__Pyx_setup_reduce((PyObject *) __pyx_MemviewEnum_type) < 0) __PYX_ERR(1, 302, __pyx_L1_error)
26678 : #endif
26679 3 : __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
26680 3 : __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
26681 3 : __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
26682 3 : __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
26683 3 : __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
26684 3 : __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
26685 3 : __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
26686 3 : __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
26687 3 : __pyx_vtable_memoryview._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryview__get_base;
26688 : #if CYTHON_USE_TYPE_SPECS
26689 : __pyx_memoryview_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryview_spec, NULL); if (unlikely(!__pyx_memoryview_type)) __PYX_ERR(1, 337, __pyx_L1_error)
26690 : #if !CYTHON_COMPILING_IN_LIMITED_API
26691 : __pyx_memoryview_type->tp_as_buffer = &__pyx_tp_as_buffer_memoryview;
26692 : if (!__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer && __pyx_memoryview_type->tp_base->tp_as_buffer && __pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer) {
26693 : __pyx_memoryview_type->tp_as_buffer->bf_releasebuffer = __pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer;
26694 : }
26695 : #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
26696 : /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
26697 : #elif defined(_MSC_VER)
26698 : #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
26699 : #else
26700 : #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
26701 : #endif
26702 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_memoryview_spec, __pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
26703 : #else
26704 3 : __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
26705 : #endif
26706 : #if !CYTHON_COMPILING_IN_LIMITED_API
26707 : #endif
26708 : #if !CYTHON_USE_TYPE_SPECS
26709 3 : if (__Pyx_PyType_Ready(__pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
26710 : #endif
26711 : #if PY_MAJOR_VERSION < 3
26712 : __pyx_memoryview_type->tp_print = 0;
26713 : #endif
26714 : #if !CYTHON_COMPILING_IN_LIMITED_API
26715 3 : if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_memoryview_type->tp_dictoffset && __pyx_memoryview_type->tp_getattro == PyObject_GenericGetAttr)) {
26716 3 : __pyx_memoryview_type->tp_getattro = __Pyx_PyObject_GenericGetAttr;
26717 : }
26718 : #endif
26719 3 : if (__Pyx_SetVtable(__pyx_memoryview_type, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
26720 : #if !CYTHON_COMPILING_IN_LIMITED_API
26721 3 : if (__Pyx_MergeVtables(__pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
26722 : #endif
26723 : #if !CYTHON_COMPILING_IN_LIMITED_API
26724 3 : if (__Pyx_setup_reduce((PyObject *) __pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
26725 : #endif
26726 3 : __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
26727 3 : __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
26728 3 : __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
26729 3 : __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
26730 3 : __pyx_vtable__memoryviewslice.__pyx_base._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryviewslice__get_base;
26731 : #if CYTHON_USE_TYPE_SPECS
26732 : __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_memoryview_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 952, __pyx_L1_error)
26733 : __Pyx_GOTREF(__pyx_t_1);
26734 : __pyx_memoryviewslice_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryviewslice_spec, __pyx_t_1);
26735 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
26736 : if (unlikely(!__pyx_memoryviewslice_type)) __PYX_ERR(1, 952, __pyx_L1_error)
26737 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_memoryviewslice_spec, __pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
26738 : #else
26739 3 : __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
26740 : #endif
26741 : #if !CYTHON_COMPILING_IN_LIMITED_API
26742 3 : __pyx_memoryviewslice_type->tp_base = __pyx_memoryview_type;
26743 : #endif
26744 : #if !CYTHON_USE_TYPE_SPECS
26745 3 : if (__Pyx_PyType_Ready(__pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
26746 : #endif
26747 : #if PY_MAJOR_VERSION < 3
26748 : __pyx_memoryviewslice_type->tp_print = 0;
26749 : #endif
26750 : #if !CYTHON_COMPILING_IN_LIMITED_API
26751 3 : if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_memoryviewslice_type->tp_dictoffset && __pyx_memoryviewslice_type->tp_getattro == PyObject_GenericGetAttr)) {
26752 3 : __pyx_memoryviewslice_type->tp_getattro = __Pyx_PyObject_GenericGetAttr;
26753 : }
26754 : #endif
26755 3 : if (__Pyx_SetVtable(__pyx_memoryviewslice_type, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
26756 : #if !CYTHON_COMPILING_IN_LIMITED_API
26757 3 : if (__Pyx_MergeVtables(__pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
26758 : #endif
26759 : #if !CYTHON_COMPILING_IN_LIMITED_API
26760 3 : if (__Pyx_setup_reduce((PyObject *) __pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
26761 : #endif
26762 : __Pyx_RefNannyFinishContext();
26763 : return 0;
26764 0 : __pyx_L1_error:;
26765 0 : __Pyx_XDECREF(__pyx_t_1);
26766 0 : __Pyx_RefNannyFinishContext();
26767 0 : return -1;
26768 : }
26769 :
26770 3 : static int __Pyx_modinit_type_import_code(void) {
26771 : __Pyx_RefNannyDeclarations
26772 3 : PyObject *__pyx_t_1 = NULL;
26773 3 : int __pyx_lineno = 0;
26774 3 : const char *__pyx_filename = NULL;
26775 3 : int __pyx_clineno = 0;
26776 3 : __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
26777 : /*--- Type import code ---*/
26778 3 : __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
26779 3 : __Pyx_GOTREF(__pyx_t_1);
26780 3 : __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
26781 : #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26782 : sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
26783 : #elif CYTHON_COMPILING_IN_LIMITED_API
26784 : sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
26785 : #else
26786 : sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyHeapTypeObject),
26787 : #endif
26788 3 : __Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
26789 3 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26790 3 : __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 271, __pyx_L1_error)
26791 3 : __Pyx_GOTREF(__pyx_t_1);
26792 3 : __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 271, __pyx_L1_error)
26793 3 : __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 316, __pyx_L1_error)
26794 3 : __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 320, __pyx_L1_error)
26795 3 : __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 359, __pyx_L1_error)
26796 3 : __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 847, __pyx_L1_error)
26797 3 : __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 849, __pyx_L1_error)
26798 3 : __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 851, __pyx_L1_error)
26799 3 : __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 853, __pyx_L1_error)
26800 3 : __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 855, __pyx_L1_error)
26801 3 : __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 857, __pyx_L1_error)
26802 3 : __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 859, __pyx_L1_error)
26803 3 : __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 861, __pyx_L1_error)
26804 3 : __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 863, __pyx_L1_error)
26805 3 : __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 865, __pyx_L1_error)
26806 3 : __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 929, __pyx_L1_error)
26807 3 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26808 : __Pyx_RefNannyFinishContext();
26809 : return 0;
26810 0 : __pyx_L1_error:;
26811 0 : __Pyx_XDECREF(__pyx_t_1);
26812 0 : __Pyx_RefNannyFinishContext();
26813 0 : return -1;
26814 : }
26815 :
26816 : static int __Pyx_modinit_variable_import_code(void) {
26817 : __Pyx_RefNannyDeclarations
26818 : __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
26819 : /*--- Variable import code ---*/
26820 : __Pyx_RefNannyFinishContext();
26821 : return 0;
26822 : }
26823 :
26824 : static int __Pyx_modinit_function_import_code(void) {
26825 : __Pyx_RefNannyDeclarations
26826 : __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
26827 : /*--- Function import code ---*/
26828 : __Pyx_RefNannyFinishContext();
26829 : return 0;
26830 : }
26831 :
26832 :
26833 : #if PY_MAJOR_VERSION >= 3
26834 : #if CYTHON_PEP489_MULTI_PHASE_INIT
26835 : static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
26836 : static int __pyx_pymod_exec__reordering(PyObject* module); /*proto*/
26837 : static PyModuleDef_Slot __pyx_moduledef_slots[] = {
26838 : {Py_mod_create, (void*)__pyx_pymod_create},
26839 : {Py_mod_exec, (void*)__pyx_pymod_exec__reordering},
26840 : {0, NULL}
26841 : };
26842 : #endif
26843 :
26844 : #ifdef __cplusplus
26845 : namespace {
26846 : struct PyModuleDef __pyx_moduledef =
26847 : #else
26848 : static struct PyModuleDef __pyx_moduledef =
26849 : #endif
26850 : {
26851 : PyModuleDef_HEAD_INIT,
26852 : "_reordering",
26853 : 0, /* m_doc */
26854 : #if CYTHON_PEP489_MULTI_PHASE_INIT
26855 : 0, /* m_size */
26856 : #elif CYTHON_USE_MODULE_STATE
26857 : sizeof(__pyx_mstate), /* m_size */
26858 : #else
26859 : -1, /* m_size */
26860 : #endif
26861 : __pyx_methods /* m_methods */,
26862 : #if CYTHON_PEP489_MULTI_PHASE_INIT
26863 : __pyx_moduledef_slots, /* m_slots */
26864 : #else
26865 : NULL, /* m_reload */
26866 : #endif
26867 : #if CYTHON_USE_MODULE_STATE
26868 : __pyx_m_traverse, /* m_traverse */
26869 : __pyx_m_clear, /* m_clear */
26870 : NULL /* m_free */
26871 : #else
26872 : NULL, /* m_traverse */
26873 : NULL, /* m_clear */
26874 : NULL /* m_free */
26875 : #endif
26876 : };
26877 : #ifdef __cplusplus
26878 : } /* anonymous namespace */
26879 : #endif
26880 : #endif
26881 :
26882 : #ifndef CYTHON_NO_PYINIT_EXPORT
26883 : #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
26884 : #elif PY_MAJOR_VERSION < 3
26885 : #ifdef __cplusplus
26886 : #define __Pyx_PyMODINIT_FUNC extern "C" void
26887 : #else
26888 : #define __Pyx_PyMODINIT_FUNC void
26889 : #endif
26890 : #else
26891 : #ifdef __cplusplus
26892 : #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
26893 : #else
26894 : #define __Pyx_PyMODINIT_FUNC PyObject *
26895 : #endif
26896 : #endif
26897 :
26898 :
26899 : #if PY_MAJOR_VERSION < 3
26900 : __Pyx_PyMODINIT_FUNC init_reordering(void) CYTHON_SMALL_CODE; /*proto*/
26901 : __Pyx_PyMODINIT_FUNC init_reordering(void)
26902 : #else
26903 : __Pyx_PyMODINIT_FUNC PyInit__reordering(void) CYTHON_SMALL_CODE; /*proto*/
26904 3 : __Pyx_PyMODINIT_FUNC PyInit__reordering(void)
26905 : #if CYTHON_PEP489_MULTI_PHASE_INIT
26906 : {
26907 3 : return PyModuleDef_Init(&__pyx_moduledef);
26908 : }
26909 3 : static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
26910 : #if PY_VERSION_HEX >= 0x030700A1
26911 3 : static PY_INT64_T main_interpreter_id = -1;
26912 3 : PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
26913 3 : if (main_interpreter_id == -1) {
26914 3 : main_interpreter_id = current_id;
26915 6 : return (unlikely(current_id == -1)) ? -1 : 0;
26916 0 : } else if (unlikely(main_interpreter_id != current_id))
26917 : #else
26918 : static PyInterpreterState *main_interpreter = NULL;
26919 : PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
26920 : if (!main_interpreter) {
26921 : main_interpreter = current_interpreter;
26922 : } else if (unlikely(main_interpreter != current_interpreter))
26923 : #endif
26924 : {
26925 0 : PyErr_SetString(
26926 : PyExc_ImportError,
26927 : "Interpreter change detected - this module can only be loaded into one interpreter per process.");
26928 0 : return -1;
26929 : }
26930 : return 0;
26931 : }
26932 : #if CYTHON_COMPILING_IN_LIMITED_API
26933 : static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none)
26934 : #else
26935 12 : static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
26936 : #endif
26937 : {
26938 12 : PyObject *value = PyObject_GetAttrString(spec, from_name);
26939 12 : int result = 0;
26940 12 : if (likely(value)) {
26941 12 : if (allow_none || value != Py_None) {
26942 : #if CYTHON_COMPILING_IN_LIMITED_API
26943 : result = PyModule_AddObject(module, to_name, value);
26944 : #else
26945 9 : result = PyDict_SetItemString(moddict, to_name, value);
26946 : #endif
26947 : }
26948 12 : Py_DECREF(value);
26949 0 : } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
26950 0 : PyErr_Clear();
26951 : } else {
26952 : result = -1;
26953 : }
26954 12 : return result;
26955 : }
26956 3 : static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
26957 3 : PyObject *module = NULL, *moddict, *modname;
26958 3 : CYTHON_UNUSED_VAR(def);
26959 3 : if (__Pyx_check_single_interpreter())
26960 : return NULL;
26961 3 : if (__pyx_m)
26962 0 : return __Pyx_NewRef(__pyx_m);
26963 3 : modname = PyObject_GetAttrString(spec, "name");
26964 3 : if (unlikely(!modname)) goto bad;
26965 3 : module = PyModule_NewObject(modname);
26966 3 : Py_DECREF(modname);
26967 3 : if (unlikely(!module)) goto bad;
26968 : #if CYTHON_COMPILING_IN_LIMITED_API
26969 : moddict = module;
26970 : #else
26971 3 : moddict = PyModule_GetDict(module);
26972 3 : if (unlikely(!moddict)) goto bad;
26973 : #endif
26974 3 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
26975 3 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
26976 3 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
26977 3 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
26978 : return module;
26979 0 : bad:
26980 0 : Py_XDECREF(module);
26981 0 : return NULL;
26982 : }
26983 :
26984 :
26985 3 : static CYTHON_SMALL_CODE int __pyx_pymod_exec__reordering(PyObject *__pyx_pyinit_module)
26986 : #endif
26987 : #endif
26988 : {
26989 3 : int stringtab_initialized = 0;
26990 : #if CYTHON_USE_MODULE_STATE
26991 : int pystate_addmodule_run = 0;
26992 : #endif
26993 3 : PyObject *__pyx_t_1 = NULL;
26994 3 : PyObject *__pyx_t_2 = NULL;
26995 3 : PyObject *__pyx_t_3 = NULL;
26996 3 : PyObject *__pyx_t_4 = NULL;
26997 3 : PyObject *__pyx_t_5 = NULL;
26998 3 : int __pyx_t_6;
26999 3 : PyObject *__pyx_t_7 = NULL;
27000 3 : static PyThread_type_lock __pyx_t_8[8];
27001 3 : int __pyx_t_9;
27002 3 : int __pyx_lineno = 0;
27003 3 : const char *__pyx_filename = NULL;
27004 3 : int __pyx_clineno = 0;
27005 : __Pyx_RefNannyDeclarations
27006 : #if CYTHON_PEP489_MULTI_PHASE_INIT
27007 3 : if (__pyx_m) {
27008 0 : if (__pyx_m == __pyx_pyinit_module) return 0;
27009 0 : PyErr_SetString(PyExc_RuntimeError, "Module '_reordering' has already been imported. Re-initialisation is not supported.");
27010 0 : return -1;
27011 : }
27012 : #elif PY_MAJOR_VERSION >= 3
27013 : if (__pyx_m) return __Pyx_NewRef(__pyx_m);
27014 : #endif
27015 : /*--- Module creation code ---*/
27016 : #if CYTHON_PEP489_MULTI_PHASE_INIT
27017 3 : __pyx_m = __pyx_pyinit_module;
27018 3 : Py_INCREF(__pyx_m);
27019 : #else
27020 : #if PY_MAJOR_VERSION < 3
27021 : __pyx_m = Py_InitModule4("_reordering", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
27022 : if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
27023 : #elif CYTHON_USE_MODULE_STATE
27024 : __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
27025 : {
27026 : int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
27027 : __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_reordering" pseudovariable */
27028 : if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27029 : pystate_addmodule_run = 1;
27030 : }
27031 : #else
27032 : __pyx_m = PyModule_Create(&__pyx_moduledef);
27033 : if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
27034 : #endif
27035 : #endif
27036 3 : CYTHON_UNUSED_VAR(__pyx_t_1);
27037 3 : __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
27038 3 : Py_INCREF(__pyx_d);
27039 3 : __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
27040 3 : __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
27041 3 : if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27042 : #if CYTHON_REFNANNY
27043 : __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
27044 : if (!__Pyx_RefNanny) {
27045 : PyErr_Clear();
27046 : __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
27047 : if (!__Pyx_RefNanny)
27048 : Py_FatalError("failed to import 'refnanny' module");
27049 : }
27050 : #endif
27051 3 : __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__reordering(void)", 0);
27052 3 : if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27053 : #ifdef __Pxy_PyFrame_Initialize_Offsets
27054 : __Pxy_PyFrame_Initialize_Offsets();
27055 : #endif
27056 3 : __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
27057 3 : __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
27058 3 : __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
27059 : #ifdef __Pyx_CyFunction_USED
27060 3 : if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27061 : #endif
27062 : #ifdef __Pyx_FusedFunction_USED
27063 3 : if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27064 : #endif
27065 : #ifdef __Pyx_Coroutine_USED
27066 : if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27067 : #endif
27068 : #ifdef __Pyx_Generator_USED
27069 : if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27070 : #endif
27071 : #ifdef __Pyx_AsyncGen_USED
27072 : if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27073 : #endif
27074 : #ifdef __Pyx_StopAsyncIteration_USED
27075 : if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27076 : #endif
27077 : /*--- Library function declarations ---*/
27078 : /*--- Threads initialization code ---*/
27079 : #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
27080 : PyEval_InitThreads();
27081 : #endif
27082 : /*--- Initialize various global constants etc. ---*/
27083 3 : if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27084 3 : stringtab_initialized = 1;
27085 3 : if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27086 : #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
27087 : if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27088 : #endif
27089 3 : if (__pyx_module_is_main_scipy__sparse__csgraph___reordering) {
27090 0 : if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27091 : }
27092 : #if PY_MAJOR_VERSION >= 3
27093 : {
27094 3 : PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
27095 3 : if (!PyDict_GetItemString(modules, "scipy.sparse.csgraph._reordering")) {
27096 0 : if (unlikely((PyDict_SetItemString(modules, "scipy.sparse.csgraph._reordering", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27097 : }
27098 : }
27099 : #endif
27100 : /*--- Builtin init code ---*/
27101 3 : if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27102 : /*--- Constants init code ---*/
27103 3 : if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27104 : /*--- Global type/function init code ---*/
27105 3 : (void)__Pyx_modinit_global_init_code();
27106 3 : (void)__Pyx_modinit_variable_export_code();
27107 3 : (void)__Pyx_modinit_function_export_code();
27108 3 : if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27109 3 : if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27110 3 : (void)__Pyx_modinit_variable_import_code();
27111 3 : (void)__Pyx_modinit_function_import_code();
27112 : /*--- Execution code ---*/
27113 : #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
27114 : if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27115 : #endif
27116 :
27117 : /* "View.MemoryView":99
27118 : *
27119 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27120 : * try: # <<<<<<<<<<<<<<
27121 : * if __import__("sys").version_info >= (3, 3):
27122 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27123 : */
27124 : {
27125 3 : __Pyx_PyThreadState_declare
27126 3 : __Pyx_PyThreadState_assign
27127 3 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
27128 3 : __Pyx_XGOTREF(__pyx_t_1);
27129 3 : __Pyx_XGOTREF(__pyx_t_2);
27130 3 : __Pyx_XGOTREF(__pyx_t_3);
27131 : /*try:*/ {
27132 :
27133 : /* "View.MemoryView":100
27134 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27135 : * try:
27136 : * if __import__("sys").version_info >= (3, 3): # <<<<<<<<<<<<<<
27137 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27138 : * else:
27139 : */
27140 3 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 100, __pyx_L2_error)
27141 3 : __Pyx_GOTREF(__pyx_t_4);
27142 3 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_version_info); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 100, __pyx_L2_error)
27143 3 : __Pyx_GOTREF(__pyx_t_5);
27144 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27145 3 : __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_tuple__20, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 100, __pyx_L2_error)
27146 3 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27147 3 : __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 100, __pyx_L2_error)
27148 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27149 3 : if (__pyx_t_6) {
27150 :
27151 : /* "View.MemoryView":101
27152 : * try:
27153 : * if __import__("sys").version_info >= (3, 3):
27154 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence # <<<<<<<<<<<<<<
27155 : * else:
27156 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence
27157 : */
27158 3 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 101, __pyx_L2_error)
27159 3 : __Pyx_GOTREF(__pyx_t_4);
27160 3 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_abc); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 101, __pyx_L2_error)
27161 3 : __Pyx_GOTREF(__pyx_t_5);
27162 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27163 3 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 101, __pyx_L2_error)
27164 3 : __Pyx_GOTREF(__pyx_t_4);
27165 3 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27166 3 : __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
27167 3 : __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_4);
27168 3 : __Pyx_GIVEREF(__pyx_t_4);
27169 3 : __pyx_t_4 = 0;
27170 :
27171 : /* "View.MemoryView":100
27172 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27173 : * try:
27174 : * if __import__("sys").version_info >= (3, 3): # <<<<<<<<<<<<<<
27175 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27176 : * else:
27177 : */
27178 3 : goto __pyx_L8;
27179 : }
27180 :
27181 : /* "View.MemoryView":103
27182 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27183 : * else:
27184 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence # <<<<<<<<<<<<<<
27185 : * except:
27186 : *
27187 : */
27188 : /*else*/ {
27189 0 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 103, __pyx_L2_error)
27190 0 : __Pyx_GOTREF(__pyx_t_4);
27191 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 103, __pyx_L2_error)
27192 0 : __Pyx_GOTREF(__pyx_t_5);
27193 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27194 0 : __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
27195 0 : __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_5);
27196 0 : __Pyx_GIVEREF(__pyx_t_5);
27197 0 : __pyx_t_5 = 0;
27198 : }
27199 3 : __pyx_L8:;
27200 :
27201 : /* "View.MemoryView":99
27202 : *
27203 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27204 : * try: # <<<<<<<<<<<<<<
27205 : * if __import__("sys").version_info >= (3, 3):
27206 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27207 : */
27208 : }
27209 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27210 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27211 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27212 3 : goto __pyx_L7_try_end;
27213 0 : __pyx_L2_error:;
27214 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27215 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27216 :
27217 : /* "View.MemoryView":104
27218 : * else:
27219 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence
27220 : * except: # <<<<<<<<<<<<<<
27221 : *
27222 : * __pyx_collections_abc_Sequence = None
27223 : */
27224 : /*except:*/ {
27225 0 : __Pyx_AddTraceback("View.MemoryView", __pyx_clineno, __pyx_lineno, __pyx_filename);
27226 0 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(1, 104, __pyx_L4_except_error)
27227 0 : __Pyx_XGOTREF(__pyx_t_5);
27228 0 : __Pyx_XGOTREF(__pyx_t_4);
27229 0 : __Pyx_XGOTREF(__pyx_t_7);
27230 :
27231 : /* "View.MemoryView":106
27232 : * except:
27233 : *
27234 : * __pyx_collections_abc_Sequence = None # <<<<<<<<<<<<<<
27235 : *
27236 : *
27237 : */
27238 0 : __Pyx_INCREF(Py_None);
27239 0 : __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
27240 0 : __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, Py_None);
27241 0 : __Pyx_GIVEREF(Py_None);
27242 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27243 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27244 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
27245 0 : goto __pyx_L3_exception_handled;
27246 : }
27247 :
27248 : /* "View.MemoryView":99
27249 : *
27250 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27251 : * try: # <<<<<<<<<<<<<<
27252 : * if __import__("sys").version_info >= (3, 3):
27253 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27254 : */
27255 0 : __pyx_L4_except_error:;
27256 0 : __Pyx_XGIVEREF(__pyx_t_1);
27257 0 : __Pyx_XGIVEREF(__pyx_t_2);
27258 0 : __Pyx_XGIVEREF(__pyx_t_3);
27259 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
27260 0 : goto __pyx_L1_error;
27261 0 : __pyx_L3_exception_handled:;
27262 0 : __Pyx_XGIVEREF(__pyx_t_1);
27263 0 : __Pyx_XGIVEREF(__pyx_t_2);
27264 0 : __Pyx_XGIVEREF(__pyx_t_3);
27265 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
27266 3 : __pyx_L7_try_end:;
27267 : }
27268 :
27269 : /* "View.MemoryView":241
27270 : *
27271 : *
27272 : * try: # <<<<<<<<<<<<<<
27273 : * count = __pyx_collections_abc_Sequence.count
27274 : * index = __pyx_collections_abc_Sequence.index
27275 : */
27276 : {
27277 3 : __Pyx_PyThreadState_declare
27278 3 : __Pyx_PyThreadState_assign
27279 3 : __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
27280 3 : __Pyx_XGOTREF(__pyx_t_3);
27281 3 : __Pyx_XGOTREF(__pyx_t_2);
27282 3 : __Pyx_XGOTREF(__pyx_t_1);
27283 : /*try:*/ {
27284 :
27285 : /* "View.MemoryView":242
27286 : *
27287 : * try:
27288 : * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<<
27289 : * index = __pyx_collections_abc_Sequence.index
27290 : * except:
27291 : */
27292 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 242, __pyx_L11_error)
27293 3 : __Pyx_GOTREF(__pyx_t_7);
27294 3 : if (__Pyx_SetItemOnTypeDict(__pyx_array_type, __pyx_n_s_count, __pyx_t_7) < 0) __PYX_ERR(1, 242, __pyx_L11_error)
27295 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27296 3 : PyType_Modified(__pyx_array_type);
27297 :
27298 : /* "View.MemoryView":243
27299 : * try:
27300 : * count = __pyx_collections_abc_Sequence.count
27301 : * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<<
27302 : * except:
27303 : * pass
27304 : */
27305 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 243, __pyx_L11_error)
27306 3 : __Pyx_GOTREF(__pyx_t_7);
27307 3 : if (__Pyx_SetItemOnTypeDict(__pyx_array_type, __pyx_n_s_index, __pyx_t_7) < 0) __PYX_ERR(1, 243, __pyx_L11_error)
27308 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27309 3 : PyType_Modified(__pyx_array_type);
27310 :
27311 : /* "View.MemoryView":241
27312 : *
27313 : *
27314 : * try: # <<<<<<<<<<<<<<
27315 : * count = __pyx_collections_abc_Sequence.count
27316 : * index = __pyx_collections_abc_Sequence.index
27317 : */
27318 : }
27319 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27320 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27321 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27322 3 : goto __pyx_L16_try_end;
27323 0 : __pyx_L11_error:;
27324 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27325 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27326 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
27327 :
27328 : /* "View.MemoryView":244
27329 : * count = __pyx_collections_abc_Sequence.count
27330 : * index = __pyx_collections_abc_Sequence.index
27331 : * except: # <<<<<<<<<<<<<<
27332 : * pass
27333 : *
27334 : */
27335 : /*except:*/ {
27336 0 : __Pyx_ErrRestore(0,0,0);
27337 0 : goto __pyx_L12_exception_handled;
27338 : }
27339 0 : __pyx_L12_exception_handled:;
27340 0 : __Pyx_XGIVEREF(__pyx_t_3);
27341 0 : __Pyx_XGIVEREF(__pyx_t_2);
27342 0 : __Pyx_XGIVEREF(__pyx_t_1);
27343 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
27344 3 : __pyx_L16_try_end:;
27345 : }
27346 :
27347 : /* "View.MemoryView":309
27348 : * return self.name
27349 : *
27350 : * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
27351 : * cdef strided = Enum("<strided and direct>") # default
27352 : * cdef indirect = Enum("<strided and indirect>")
27353 : */
27354 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 309, __pyx_L1_error)
27355 3 : __Pyx_GOTREF(__pyx_t_7);
27356 3 : __Pyx_XGOTREF(generic);
27357 3 : __Pyx_DECREF_SET(generic, __pyx_t_7);
27358 3 : __Pyx_GIVEREF(__pyx_t_7);
27359 3 : __pyx_t_7 = 0;
27360 :
27361 : /* "View.MemoryView":310
27362 : *
27363 : * cdef generic = Enum("<strided and direct or indirect>")
27364 : * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
27365 : * cdef indirect = Enum("<strided and indirect>")
27366 : *
27367 : */
27368 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 310, __pyx_L1_error)
27369 3 : __Pyx_GOTREF(__pyx_t_7);
27370 3 : __Pyx_XGOTREF(strided);
27371 3 : __Pyx_DECREF_SET(strided, __pyx_t_7);
27372 3 : __Pyx_GIVEREF(__pyx_t_7);
27373 3 : __pyx_t_7 = 0;
27374 :
27375 : /* "View.MemoryView":311
27376 : * cdef generic = Enum("<strided and direct or indirect>")
27377 : * cdef strided = Enum("<strided and direct>") # default
27378 : * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
27379 : *
27380 : *
27381 : */
27382 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 311, __pyx_L1_error)
27383 3 : __Pyx_GOTREF(__pyx_t_7);
27384 3 : __Pyx_XGOTREF(indirect);
27385 3 : __Pyx_DECREF_SET(indirect, __pyx_t_7);
27386 3 : __Pyx_GIVEREF(__pyx_t_7);
27387 3 : __pyx_t_7 = 0;
27388 :
27389 : /* "View.MemoryView":314
27390 : *
27391 : *
27392 : * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
27393 : * cdef indirect_contiguous = Enum("<contiguous and indirect>")
27394 : *
27395 : */
27396 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 314, __pyx_L1_error)
27397 3 : __Pyx_GOTREF(__pyx_t_7);
27398 3 : __Pyx_XGOTREF(contiguous);
27399 3 : __Pyx_DECREF_SET(contiguous, __pyx_t_7);
27400 3 : __Pyx_GIVEREF(__pyx_t_7);
27401 3 : __pyx_t_7 = 0;
27402 :
27403 : /* "View.MemoryView":315
27404 : *
27405 : * cdef contiguous = Enum("<contiguous and direct>")
27406 : * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
27407 : *
27408 : *
27409 : */
27410 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 315, __pyx_L1_error)
27411 3 : __Pyx_GOTREF(__pyx_t_7);
27412 3 : __Pyx_XGOTREF(indirect_contiguous);
27413 3 : __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_7);
27414 3 : __Pyx_GIVEREF(__pyx_t_7);
27415 3 : __pyx_t_7 = 0;
27416 :
27417 : /* "View.MemoryView":323
27418 : *
27419 : *
27420 : * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
27421 : * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [
27422 : * PyThread_allocate_lock(),
27423 : */
27424 3 : __pyx_memoryview_thread_locks_used = 0;
27425 :
27426 : /* "View.MemoryView":324
27427 : *
27428 : * cdef int __pyx_memoryview_thread_locks_used = 0
27429 : * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
27430 : * PyThread_allocate_lock(),
27431 : * PyThread_allocate_lock(),
27432 : */
27433 3 : __pyx_t_8[0] = PyThread_allocate_lock();
27434 3 : __pyx_t_8[1] = PyThread_allocate_lock();
27435 3 : __pyx_t_8[2] = PyThread_allocate_lock();
27436 3 : __pyx_t_8[3] = PyThread_allocate_lock();
27437 3 : __pyx_t_8[4] = PyThread_allocate_lock();
27438 3 : __pyx_t_8[5] = PyThread_allocate_lock();
27439 3 : __pyx_t_8[6] = PyThread_allocate_lock();
27440 3 : __pyx_t_8[7] = PyThread_allocate_lock();
27441 3 : memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_8, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
27442 :
27443 : /* "View.MemoryView":982
27444 : *
27445 : *
27446 : * try: # <<<<<<<<<<<<<<
27447 : * count = __pyx_collections_abc_Sequence.count
27448 : * index = __pyx_collections_abc_Sequence.index
27449 : */
27450 : {
27451 3 : __Pyx_PyThreadState_declare
27452 3 : __Pyx_PyThreadState_assign
27453 3 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
27454 3 : __Pyx_XGOTREF(__pyx_t_1);
27455 3 : __Pyx_XGOTREF(__pyx_t_2);
27456 3 : __Pyx_XGOTREF(__pyx_t_3);
27457 : /*try:*/ {
27458 :
27459 : /* "View.MemoryView":983
27460 : *
27461 : * try:
27462 : * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<<
27463 : * index = __pyx_collections_abc_Sequence.index
27464 : * except:
27465 : */
27466 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 983, __pyx_L17_error)
27467 3 : __Pyx_GOTREF(__pyx_t_7);
27468 3 : if (__Pyx_SetItemOnTypeDict(__pyx_memoryviewslice_type, __pyx_n_s_count, __pyx_t_7) < 0) __PYX_ERR(1, 983, __pyx_L17_error)
27469 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27470 3 : PyType_Modified(__pyx_memoryviewslice_type);
27471 :
27472 : /* "View.MemoryView":984
27473 : * try:
27474 : * count = __pyx_collections_abc_Sequence.count
27475 : * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<<
27476 : * except:
27477 : * pass
27478 : */
27479 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 984, __pyx_L17_error)
27480 3 : __Pyx_GOTREF(__pyx_t_7);
27481 3 : if (__Pyx_SetItemOnTypeDict(__pyx_memoryviewslice_type, __pyx_n_s_index, __pyx_t_7) < 0) __PYX_ERR(1, 984, __pyx_L17_error)
27482 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27483 3 : PyType_Modified(__pyx_memoryviewslice_type);
27484 :
27485 : /* "View.MemoryView":982
27486 : *
27487 : *
27488 : * try: # <<<<<<<<<<<<<<
27489 : * count = __pyx_collections_abc_Sequence.count
27490 : * index = __pyx_collections_abc_Sequence.index
27491 : */
27492 : }
27493 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27494 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27495 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27496 3 : goto __pyx_L22_try_end;
27497 0 : __pyx_L17_error:;
27498 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27499 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27500 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
27501 :
27502 : /* "View.MemoryView":985
27503 : * count = __pyx_collections_abc_Sequence.count
27504 : * index = __pyx_collections_abc_Sequence.index
27505 : * except: # <<<<<<<<<<<<<<
27506 : * pass
27507 : *
27508 : */
27509 : /*except:*/ {
27510 0 : __Pyx_ErrRestore(0,0,0);
27511 0 : goto __pyx_L18_exception_handled;
27512 : }
27513 0 : __pyx_L18_exception_handled:;
27514 0 : __Pyx_XGIVEREF(__pyx_t_1);
27515 0 : __Pyx_XGIVEREF(__pyx_t_2);
27516 0 : __Pyx_XGIVEREF(__pyx_t_3);
27517 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
27518 3 : __pyx_L22_try_end:;
27519 : }
27520 :
27521 : /* "View.MemoryView":988
27522 : * pass
27523 : *
27524 : * try: # <<<<<<<<<<<<<<
27525 : * if __pyx_collections_abc_Sequence:
27526 : *
27527 : */
27528 : {
27529 3 : __Pyx_PyThreadState_declare
27530 3 : __Pyx_PyThreadState_assign
27531 3 : __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
27532 3 : __Pyx_XGOTREF(__pyx_t_3);
27533 3 : __Pyx_XGOTREF(__pyx_t_2);
27534 3 : __Pyx_XGOTREF(__pyx_t_1);
27535 : /*try:*/ {
27536 :
27537 : /* "View.MemoryView":989
27538 : *
27539 : * try:
27540 : * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<<
27541 : *
27542 : *
27543 : */
27544 3 : __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_collections_abc_Sequence); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 989, __pyx_L23_error)
27545 3 : if (__pyx_t_6) {
27546 :
27547 : /* "View.MemoryView":993
27548 : *
27549 : *
27550 : * __pyx_collections_abc_Sequence.register(_memoryviewslice) # <<<<<<<<<<<<<<
27551 : * __pyx_collections_abc_Sequence.register(array)
27552 : * except:
27553 : */
27554 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_register); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 993, __pyx_L23_error)
27555 3 : __Pyx_GOTREF(__pyx_t_7);
27556 3 : __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_memoryviewslice_type)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 993, __pyx_L23_error)
27557 3 : __Pyx_GOTREF(__pyx_t_4);
27558 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27559 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27560 :
27561 : /* "View.MemoryView":994
27562 : *
27563 : * __pyx_collections_abc_Sequence.register(_memoryviewslice)
27564 : * __pyx_collections_abc_Sequence.register(array) # <<<<<<<<<<<<<<
27565 : * except:
27566 : * pass # ignore failure, it's a minor issue
27567 : */
27568 3 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_register); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 994, __pyx_L23_error)
27569 3 : __Pyx_GOTREF(__pyx_t_4);
27570 3 : __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_array_type)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 994, __pyx_L23_error)
27571 3 : __Pyx_GOTREF(__pyx_t_7);
27572 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27573 6 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27574 :
27575 : /* "View.MemoryView":989
27576 : *
27577 : * try:
27578 : * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<<
27579 : *
27580 : *
27581 : */
27582 : }
27583 :
27584 : /* "View.MemoryView":988
27585 : * pass
27586 : *
27587 : * try: # <<<<<<<<<<<<<<
27588 : * if __pyx_collections_abc_Sequence:
27589 : *
27590 : */
27591 : }
27592 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27593 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27594 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27595 3 : goto __pyx_L28_try_end;
27596 0 : __pyx_L23_error:;
27597 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27598 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27599 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
27600 :
27601 : /* "View.MemoryView":995
27602 : * __pyx_collections_abc_Sequence.register(_memoryviewslice)
27603 : * __pyx_collections_abc_Sequence.register(array)
27604 : * except: # <<<<<<<<<<<<<<
27605 : * pass # ignore failure, it's a minor issue
27606 : *
27607 : */
27608 : /*except:*/ {
27609 0 : __Pyx_ErrRestore(0,0,0);
27610 0 : goto __pyx_L24_exception_handled;
27611 : }
27612 0 : __pyx_L24_exception_handled:;
27613 0 : __Pyx_XGIVEREF(__pyx_t_3);
27614 0 : __Pyx_XGIVEREF(__pyx_t_2);
27615 0 : __Pyx_XGIVEREF(__pyx_t_1);
27616 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
27617 3 : __pyx_L28_try_end:;
27618 : }
27619 :
27620 : /* "(tree fragment)":1
27621 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
27622 : * cdef object __pyx_PickleError
27623 : * cdef object __pyx_result
27624 : */
27625 3 : __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1, __pyx_L1_error)
27626 3 : __Pyx_GOTREF(__pyx_t_7);
27627 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_7) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
27628 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27629 :
27630 : /* "scipy/sparse/csgraph/_reordering.pyx":5
27631 : * # License: New BSD, (C) 2014
27632 : *
27633 : * import numpy as np # <<<<<<<<<<<<<<
27634 : * cimport numpy as np
27635 : * from warnings import warn
27636 : */
27637 3 : __pyx_t_7 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5, __pyx_L1_error)
27638 3 : __Pyx_GOTREF(__pyx_t_7);
27639 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_7) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
27640 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27641 :
27642 : /* "scipy/sparse/csgraph/_reordering.pyx":7
27643 : * import numpy as np
27644 : * cimport numpy as np
27645 : * from warnings import warn # <<<<<<<<<<<<<<
27646 : * from scipy.sparse import csr_array, issparse, SparseEfficiencyWarning
27647 : * from scipy.sparse._sputils import convert_pydata_sparse_to_scipy
27648 : */
27649 3 : __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 7, __pyx_L1_error)
27650 3 : __Pyx_GOTREF(__pyx_t_7);
27651 3 : __Pyx_INCREF(__pyx_n_s_warn);
27652 3 : __Pyx_GIVEREF(__pyx_n_s_warn);
27653 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_warn)) __PYX_ERR(0, 7, __pyx_L1_error);
27654 3 : __pyx_t_4 = __Pyx_Import(__pyx_n_s_warnings, __pyx_t_7, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7, __pyx_L1_error)
27655 3 : __Pyx_GOTREF(__pyx_t_4);
27656 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27657 3 : __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_warn); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 7, __pyx_L1_error)
27658 3 : __Pyx_GOTREF(__pyx_t_7);
27659 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_warn, __pyx_t_7) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
27660 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27661 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27662 :
27663 : /* "scipy/sparse/csgraph/_reordering.pyx":8
27664 : * cimport numpy as np
27665 : * from warnings import warn
27666 : * from scipy.sparse import csr_array, issparse, SparseEfficiencyWarning # <<<<<<<<<<<<<<
27667 : * from scipy.sparse._sputils import convert_pydata_sparse_to_scipy
27668 : * from . import maximum_bipartite_matching
27669 : */
27670 3 : __pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 8, __pyx_L1_error)
27671 3 : __Pyx_GOTREF(__pyx_t_4);
27672 3 : __Pyx_INCREF(__pyx_n_s_csr_array);
27673 3 : __Pyx_GIVEREF(__pyx_n_s_csr_array);
27674 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_csr_array)) __PYX_ERR(0, 8, __pyx_L1_error);
27675 3 : __Pyx_INCREF(__pyx_n_s_issparse);
27676 3 : __Pyx_GIVEREF(__pyx_n_s_issparse);
27677 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_issparse)) __PYX_ERR(0, 8, __pyx_L1_error);
27678 3 : __Pyx_INCREF(__pyx_n_s_SparseEfficiencyWarning);
27679 3 : __Pyx_GIVEREF(__pyx_n_s_SparseEfficiencyWarning);
27680 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 2, __pyx_n_s_SparseEfficiencyWarning)) __PYX_ERR(0, 8, __pyx_L1_error);
27681 3 : __pyx_t_7 = __Pyx_Import(__pyx_n_s_scipy_sparse, __pyx_t_4, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 8, __pyx_L1_error)
27682 3 : __Pyx_GOTREF(__pyx_t_7);
27683 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27684 3 : __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_csr_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 8, __pyx_L1_error)
27685 3 : __Pyx_GOTREF(__pyx_t_4);
27686 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_csr_array, __pyx_t_4) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
27687 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27688 3 : __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_issparse); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 8, __pyx_L1_error)
27689 3 : __Pyx_GOTREF(__pyx_t_4);
27690 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_issparse, __pyx_t_4) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
27691 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27692 3 : __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_SparseEfficiencyWarning); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 8, __pyx_L1_error)
27693 3 : __Pyx_GOTREF(__pyx_t_4);
27694 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_SparseEfficiencyWarning, __pyx_t_4) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
27695 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27696 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27697 :
27698 : /* "scipy/sparse/csgraph/_reordering.pyx":9
27699 : * from warnings import warn
27700 : * from scipy.sparse import csr_array, issparse, SparseEfficiencyWarning
27701 : * from scipy.sparse._sputils import convert_pydata_sparse_to_scipy # <<<<<<<<<<<<<<
27702 : * from . import maximum_bipartite_matching
27703 : *
27704 : */
27705 3 : __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 9, __pyx_L1_error)
27706 3 : __Pyx_GOTREF(__pyx_t_7);
27707 3 : __Pyx_INCREF(__pyx_n_s_convert_pydata_sparse_to_scipy);
27708 3 : __Pyx_GIVEREF(__pyx_n_s_convert_pydata_sparse_to_scipy);
27709 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_convert_pydata_sparse_to_scipy)) __PYX_ERR(0, 9, __pyx_L1_error);
27710 3 : __pyx_t_4 = __Pyx_Import(__pyx_n_s_scipy_sparse__sputils, __pyx_t_7, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 9, __pyx_L1_error)
27711 3 : __Pyx_GOTREF(__pyx_t_4);
27712 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27713 3 : __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_convert_pydata_sparse_to_scipy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 9, __pyx_L1_error)
27714 3 : __Pyx_GOTREF(__pyx_t_7);
27715 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_convert_pydata_sparse_to_scipy, __pyx_t_7) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
27716 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27717 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27718 :
27719 : /* "scipy/sparse/csgraph/_reordering.pyx":10
27720 : * from scipy.sparse import csr_array, issparse, SparseEfficiencyWarning
27721 : * from scipy.sparse._sputils import convert_pydata_sparse_to_scipy
27722 : * from . import maximum_bipartite_matching # <<<<<<<<<<<<<<
27723 : *
27724 : * np.import_array()
27725 : */
27726 3 : __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 10, __pyx_L1_error)
27727 3 : __Pyx_GOTREF(__pyx_t_4);
27728 3 : __Pyx_INCREF(__pyx_n_s_maximum_bipartite_matching);
27729 3 : __Pyx_GIVEREF(__pyx_n_s_maximum_bipartite_matching);
27730 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_maximum_bipartite_matching)) __PYX_ERR(0, 10, __pyx_L1_error);
27731 3 : __pyx_t_7 = __Pyx_Import(__pyx_n_s__30, __pyx_t_4, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 10, __pyx_L1_error)
27732 3 : __Pyx_GOTREF(__pyx_t_7);
27733 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27734 3 : __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_maximum_bipartite_matching); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 10, __pyx_L1_error)
27735 3 : __Pyx_GOTREF(__pyx_t_4);
27736 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_maximum_bipartite_matching, __pyx_t_4) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
27737 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27738 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27739 :
27740 : /* "scipy/sparse/csgraph/_reordering.pyx":12
27741 : * from . import maximum_bipartite_matching
27742 : *
27743 : * np.import_array() # <<<<<<<<<<<<<<
27744 : *
27745 : * include 'parameters.pxi'
27746 : */
27747 3 : __pyx_t_9 = __pyx_f_5numpy_import_array(); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 12, __pyx_L1_error)
27748 :
27749 : /* "../scipy/sparse/csgraph/parameters.pxi":2
27750 : *
27751 : * DTYPE = np.float64 # <<<<<<<<<<<<<<
27752 : * ctypedef np.float64_t DTYPE_t
27753 : *
27754 : */
27755 3 : __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2, __pyx_L1_error)
27756 3 : __Pyx_GOTREF(__pyx_t_7);
27757 3 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2, __pyx_L1_error)
27758 3 : __Pyx_GOTREF(__pyx_t_4);
27759 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27760 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_DTYPE, __pyx_t_4) < 0) __PYX_ERR(4, 2, __pyx_L1_error)
27761 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27762 :
27763 : /* "../scipy/sparse/csgraph/parameters.pxi":5
27764 : * ctypedef np.float64_t DTYPE_t
27765 : *
27766 : * ITYPE = np.int32 # <<<<<<<<<<<<<<
27767 : * ctypedef np.int32_t ITYPE_t
27768 : *
27769 : */
27770 3 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 5, __pyx_L1_error)
27771 3 : __Pyx_GOTREF(__pyx_t_4);
27772 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 5, __pyx_L1_error)
27773 3 : __Pyx_GOTREF(__pyx_t_7);
27774 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27775 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_ITYPE, __pyx_t_7) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
27776 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27777 :
27778 : /* "scipy/sparse/csgraph/_reordering.pyx":16
27779 : * include 'parameters.pxi'
27780 : *
27781 : * def reverse_cuthill_mckee(graph, symmetric_mode=False): # <<<<<<<<<<<<<<
27782 : * """
27783 : * reverse_cuthill_mckee(graph, symmetric_mode=False)
27784 : */
27785 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6sparse_7csgraph_11_reordering_1reverse_cuthill_mckee, 0, __pyx_n_s_reverse_cuthill_mckee_2, NULL, __pyx_n_s_scipy_sparse_csgraph__reordering, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 16, __pyx_L1_error)
27786 3 : __Pyx_GOTREF(__pyx_t_7);
27787 6 : __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__33);
27788 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_reverse_cuthill_mckee_2, __pyx_t_7) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
27789 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27790 :
27791 : /* "scipy/sparse/csgraph/_reordering.pyx":107
27792 : *
27793 : *
27794 : * def _reverse_cuthill_mckee(np.ndarray[int32_or_int64, ndim=1, mode="c"] ind, # <<<<<<<<<<<<<<
27795 : * np.ndarray[int32_or_int64, ndim=1, mode="c"] ptr,
27796 : * np.npy_intp num_rows):
27797 : */
27798 3 : __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 107, __pyx_L1_error)
27799 3 : __Pyx_GOTREF(__pyx_t_7);
27800 3 : __pyx_t_4 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_5scipy_6sparse_7csgraph_11_reordering_7_reverse_cuthill_mckee, 0, __pyx_n_s_reverse_cuthill_mckee, NULL, __pyx_n_s_scipy_sparse_csgraph__reordering, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error)
27801 3 : __Pyx_GOTREF(__pyx_t_4);
27802 6 : __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple);
27803 3 : if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_int32_t, __pyx_t_4) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
27804 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27805 3 : __pyx_t_4 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_5scipy_6sparse_7csgraph_11_reordering_9_reverse_cuthill_mckee, 0, __pyx_n_s_reverse_cuthill_mckee, NULL, __pyx_n_s_scipy_sparse_csgraph__reordering, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error)
27806 3 : __Pyx_GOTREF(__pyx_t_4);
27807 6 : __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple);
27808 3 : if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_int64_t, __pyx_t_4) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
27809 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27810 3 : __pyx_t_4 = __pyx_FusedFunction_New(&__pyx_mdef_5scipy_6sparse_7csgraph_11_reordering_3_reverse_cuthill_mckee, 0, __pyx_n_s_reverse_cuthill_mckee, NULL, __pyx_n_s_scipy_sparse_csgraph__reordering, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error)
27811 3 : __Pyx_GOTREF(__pyx_t_4);
27812 3 : if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 107, __pyx_L1_error)
27813 3 : __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error)
27814 3 : __Pyx_GOTREF(__pyx_t_5);
27815 3 : __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_4)->__pyx_arg__fused_sigindex = __pyx_t_5;
27816 3 : __Pyx_GIVEREF(__pyx_t_5);
27817 3 : __pyx_t_5 = 0;
27818 6 : __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple);
27819 3 : ((__pyx_FusedFunctionObject *) __pyx_t_4)->__signatures__ = __pyx_t_7;
27820 3 : __Pyx_GIVEREF(__pyx_t_7);
27821 3 : __pyx_t_7 = 0;
27822 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_reverse_cuthill_mckee, __pyx_t_4) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
27823 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27824 :
27825 : /* "scipy/sparse/csgraph/_reordering.pyx":177
27826 : *
27827 : *
27828 : * def structural_rank(graph): # <<<<<<<<<<<<<<
27829 : * """
27830 : * structural_rank(graph)
27831 : */
27832 3 : __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6sparse_7csgraph_11_reordering_5structural_rank, 0, __pyx_n_s_structural_rank, NULL, __pyx_n_s_scipy_sparse_csgraph__reordering, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 177, __pyx_L1_error)
27833 3 : __Pyx_GOTREF(__pyx_t_4);
27834 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_structural_rank, __pyx_t_4) < 0) __PYX_ERR(0, 177, __pyx_L1_error)
27835 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27836 :
27837 : /* "scipy/sparse/csgraph/_reordering.pyx":1
27838 : * # Author: Paul Nation -- <nonhermitian@gmail.com> # <<<<<<<<<<<<<<
27839 : * # Original Source: QuTiP: Quantum Toolbox in Python (qutip.org)
27840 : * # License: New BSD, (C) 2014
27841 : */
27842 3 : __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
27843 3 : __Pyx_GOTREF(__pyx_t_4);
27844 3 : if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_reverse_cuthill_mckee_line_16, __pyx_kp_u_reverse_cuthill_mckee_graph_sym) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27845 3 : if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_structural_rank_line_177, __pyx_kp_u_structural_rank_graph_Compute_t) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27846 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27847 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27848 :
27849 : /*--- Wrapped vars code ---*/
27850 :
27851 3 : goto __pyx_L0;
27852 0 : __pyx_L1_error:;
27853 0 : __Pyx_XDECREF(__pyx_t_4);
27854 0 : __Pyx_XDECREF(__pyx_t_5);
27855 0 : __Pyx_XDECREF(__pyx_t_7);
27856 0 : if (__pyx_m) {
27857 0 : if (__pyx_d && stringtab_initialized) {
27858 0 : __Pyx_AddTraceback("init scipy.sparse.csgraph._reordering", __pyx_clineno, __pyx_lineno, __pyx_filename);
27859 : }
27860 : #if !CYTHON_USE_MODULE_STATE
27861 0 : Py_CLEAR(__pyx_m);
27862 : #else
27863 : Py_DECREF(__pyx_m);
27864 : if (pystate_addmodule_run) {
27865 : PyObject *tp, *value, *tb;
27866 : PyErr_Fetch(&tp, &value, &tb);
27867 : PyState_RemoveModule(&__pyx_moduledef);
27868 : PyErr_Restore(tp, value, tb);
27869 : }
27870 : #endif
27871 0 : } else if (!PyErr_Occurred()) {
27872 0 : PyErr_SetString(PyExc_ImportError, "init scipy.sparse.csgraph._reordering");
27873 : }
27874 0 : __pyx_L0:;
27875 3 : __Pyx_RefNannyFinishContext();
27876 : #if CYTHON_PEP489_MULTI_PHASE_INIT
27877 3 : return (__pyx_m != NULL) ? 0 : -1;
27878 : #elif PY_MAJOR_VERSION >= 3
27879 : return __pyx_m;
27880 : #else
27881 : return;
27882 : #endif
27883 : }
27884 : /* #### Code section: cleanup_globals ### */
27885 : /* #### Code section: cleanup_module ### */
27886 : /* #### Code section: main_method ### */
27887 : /* #### Code section: utility_code_pragmas ### */
27888 : #ifdef _MSC_VER
27889 : #pragma warning( push )
27890 : /* Warning 4127: conditional expression is constant
27891 : * Cython uses constant conditional expressions to allow in inline functions to be optimized at
27892 : * compile-time, so this warning is not useful
27893 : */
27894 : #pragma warning( disable : 4127 )
27895 : #endif
27896 :
27897 :
27898 :
27899 : /* #### Code section: utility_code_def ### */
27900 :
27901 : /* --- Runtime support code --- */
27902 : /* Refnanny */
27903 : #if CYTHON_REFNANNY
27904 : static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
27905 : PyObject *m = NULL, *p = NULL;
27906 : void *r = NULL;
27907 : m = PyImport_ImportModule(modname);
27908 : if (!m) goto end;
27909 : p = PyObject_GetAttrString(m, "RefNannyAPI");
27910 : if (!p) goto end;
27911 : r = PyLong_AsVoidPtr(p);
27912 : end:
27913 : Py_XDECREF(p);
27914 : Py_XDECREF(m);
27915 : return (__Pyx_RefNannyAPIStruct *)r;
27916 : }
27917 : #endif
27918 :
27919 : /* PyErrExceptionMatches */
27920 : #if CYTHON_FAST_THREAD_STATE
27921 0 : static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
27922 0 : Py_ssize_t i, n;
27923 0 : n = PyTuple_GET_SIZE(tuple);
27924 : #if PY_MAJOR_VERSION >= 3
27925 0 : for (i=0; i<n; i++) {
27926 0 : if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
27927 : }
27928 : #endif
27929 0 : for (i=0; i<n; i++) {
27930 0 : if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
27931 : }
27932 : return 0;
27933 : }
27934 9 : static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
27935 9 : int result;
27936 9 : PyObject *exc_type;
27937 : #if PY_VERSION_HEX >= 0x030C00A6
27938 9 : PyObject *current_exception = tstate->current_exception;
27939 9 : if (unlikely(!current_exception)) return 0;
27940 9 : exc_type = (PyObject*) Py_TYPE(current_exception);
27941 9 : if (exc_type == err) return 1;
27942 : #else
27943 : exc_type = tstate->curexc_type;
27944 : if (exc_type == err) return 1;
27945 : if (unlikely(!exc_type)) return 0;
27946 : #endif
27947 : #if CYTHON_AVOID_BORROWED_REFS
27948 : Py_INCREF(exc_type);
27949 : #endif
27950 0 : if (unlikely(PyTuple_Check(err))) {
27951 0 : result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
27952 : } else {
27953 0 : result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
27954 : }
27955 : #if CYTHON_AVOID_BORROWED_REFS
27956 : Py_DECREF(exc_type);
27957 : #endif
27958 : return result;
27959 : }
27960 : #endif
27961 :
27962 : /* PyErrFetchRestore */
27963 : #if CYTHON_FAST_THREAD_STATE
27964 9 : static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
27965 : #if PY_VERSION_HEX >= 0x030C00A6
27966 9 : PyObject *tmp_value;
27967 9 : assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
27968 9 : if (value) {
27969 : #if CYTHON_COMPILING_IN_CPYTHON
27970 0 : if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
27971 : #endif
27972 0 : PyException_SetTraceback(value, tb);
27973 : }
27974 9 : tmp_value = tstate->current_exception;
27975 9 : tstate->current_exception = value;
27976 9 : Py_XDECREF(tmp_value);
27977 9 : Py_XDECREF(type);
27978 9 : Py_XDECREF(tb);
27979 : #else
27980 : PyObject *tmp_type, *tmp_value, *tmp_tb;
27981 : tmp_type = tstate->curexc_type;
27982 : tmp_value = tstate->curexc_value;
27983 : tmp_tb = tstate->curexc_traceback;
27984 : tstate->curexc_type = type;
27985 : tstate->curexc_value = value;
27986 : tstate->curexc_traceback = tb;
27987 : Py_XDECREF(tmp_type);
27988 : Py_XDECREF(tmp_value);
27989 : Py_XDECREF(tmp_tb);
27990 : #endif
27991 9 : }
27992 0 : static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
27993 : #if PY_VERSION_HEX >= 0x030C00A6
27994 0 : PyObject* exc_value;
27995 0 : exc_value = tstate->current_exception;
27996 0 : tstate->current_exception = 0;
27997 0 : *value = exc_value;
27998 0 : *type = NULL;
27999 0 : *tb = NULL;
28000 0 : if (exc_value) {
28001 0 : *type = (PyObject*) Py_TYPE(exc_value);
28002 0 : Py_INCREF(*type);
28003 : #if CYTHON_COMPILING_IN_CPYTHON
28004 0 : *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
28005 0 : Py_XINCREF(*tb);
28006 : #else
28007 : *tb = PyException_GetTraceback(exc_value);
28008 : #endif
28009 : }
28010 : #else
28011 : *type = tstate->curexc_type;
28012 : *value = tstate->curexc_value;
28013 : *tb = tstate->curexc_traceback;
28014 : tstate->curexc_type = 0;
28015 : tstate->curexc_value = 0;
28016 : tstate->curexc_traceback = 0;
28017 : #endif
28018 0 : }
28019 : #endif
28020 :
28021 : /* PyObjectGetAttrStr */
28022 : #if CYTHON_USE_TYPE_SLOTS
28023 222 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
28024 222 : PyTypeObject* tp = Py_TYPE(obj);
28025 222 : if (likely(tp->tp_getattro))
28026 222 : return tp->tp_getattro(obj, attr_name);
28027 : #if PY_MAJOR_VERSION < 3
28028 : if (likely(tp->tp_getattr))
28029 : return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
28030 : #endif
28031 0 : return PyObject_GetAttr(obj, attr_name);
28032 : }
28033 : #endif
28034 :
28035 : /* PyObjectGetAttrStrNoError */
28036 : #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
28037 9 : static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
28038 9 : __Pyx_PyThreadState_declare
28039 9 : __Pyx_PyThreadState_assign
28040 9 : if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
28041 9 : __Pyx_PyErr_Clear();
28042 9 : }
28043 : #endif
28044 81 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
28045 81 : PyObject *result;
28046 : #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
28047 : (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
28048 : return result;
28049 : #else
28050 : #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
28051 81 : PyTypeObject* tp = Py_TYPE(obj);
28052 81 : if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
28053 9 : return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
28054 : }
28055 : #endif
28056 72 : result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
28057 72 : if (unlikely(!result)) {
28058 9 : __Pyx_PyObject_GetAttrStr_ClearAttributeError();
28059 : }
28060 : return result;
28061 : #endif
28062 : }
28063 :
28064 : /* GetBuiltinName */
28065 33 : static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
28066 33 : PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
28067 33 : if (unlikely(!result) && !PyErr_Occurred()) {
28068 0 : PyErr_Format(PyExc_NameError,
28069 : #if PY_MAJOR_VERSION >= 3
28070 : "name '%U' is not defined", name);
28071 : #else
28072 : "name '%.200s' is not defined", PyString_AS_STRING(name));
28073 : #endif
28074 : }
28075 33 : return result;
28076 : }
28077 :
28078 : /* TupleAndListFromArray */
28079 : #if CYTHON_COMPILING_IN_CPYTHON
28080 : static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
28081 : PyObject *v;
28082 : Py_ssize_t i;
28083 : for (i = 0; i < length; i++) {
28084 : v = dest[i] = src[i];
28085 : Py_INCREF(v);
28086 : }
28087 : }
28088 : static CYTHON_INLINE PyObject *
28089 : __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
28090 : {
28091 : PyObject *res;
28092 : if (n <= 0) {
28093 : Py_INCREF(__pyx_empty_tuple);
28094 : return __pyx_empty_tuple;
28095 : }
28096 : res = PyTuple_New(n);
28097 : if (unlikely(res == NULL)) return NULL;
28098 : __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
28099 : return res;
28100 : }
28101 : static CYTHON_INLINE PyObject *
28102 : __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
28103 : {
28104 : PyObject *res;
28105 : if (n <= 0) {
28106 : return PyList_New(0);
28107 : }
28108 : res = PyList_New(n);
28109 : if (unlikely(res == NULL)) return NULL;
28110 : __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
28111 : return res;
28112 : }
28113 : #endif
28114 :
28115 : /* BytesEquals */
28116 : static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
28117 : #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
28118 : return PyObject_RichCompareBool(s1, s2, equals);
28119 : #else
28120 : if (s1 == s2) {
28121 : return (equals == Py_EQ);
28122 : } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
28123 : const char *ps1, *ps2;
28124 : Py_ssize_t length = PyBytes_GET_SIZE(s1);
28125 : if (length != PyBytes_GET_SIZE(s2))
28126 : return (equals == Py_NE);
28127 : ps1 = PyBytes_AS_STRING(s1);
28128 : ps2 = PyBytes_AS_STRING(s2);
28129 : if (ps1[0] != ps2[0]) {
28130 : return (equals == Py_NE);
28131 : } else if (length == 1) {
28132 : return (equals == Py_EQ);
28133 : } else {
28134 : int result;
28135 : #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
28136 : Py_hash_t hash1, hash2;
28137 : hash1 = ((PyBytesObject*)s1)->ob_shash;
28138 : hash2 = ((PyBytesObject*)s2)->ob_shash;
28139 : if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
28140 : return (equals == Py_NE);
28141 : }
28142 : #endif
28143 : result = memcmp(ps1, ps2, (size_t)length);
28144 : return (equals == Py_EQ) ? (result == 0) : (result != 0);
28145 : }
28146 : } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
28147 : return (equals == Py_NE);
28148 : } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
28149 : return (equals == Py_NE);
28150 : } else {
28151 : int result;
28152 : PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
28153 : if (!py_result)
28154 : return -1;
28155 : result = __Pyx_PyObject_IsTrue(py_result);
28156 : Py_DECREF(py_result);
28157 : return result;
28158 : }
28159 : #endif
28160 : }
28161 :
28162 : /* UnicodeEquals */
28163 14 : static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
28164 : #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
28165 : return PyObject_RichCompareBool(s1, s2, equals);
28166 : #else
28167 : #if PY_MAJOR_VERSION < 3
28168 : PyObject* owned_ref = NULL;
28169 : #endif
28170 14 : int s1_is_unicode, s2_is_unicode;
28171 14 : if (s1 == s2) {
28172 7 : goto return_eq;
28173 : }
28174 7 : s1_is_unicode = PyUnicode_CheckExact(s1);
28175 7 : s2_is_unicode = PyUnicode_CheckExact(s2);
28176 : #if PY_MAJOR_VERSION < 3
28177 : if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
28178 : owned_ref = PyUnicode_FromObject(s2);
28179 : if (unlikely(!owned_ref))
28180 : return -1;
28181 : s2 = owned_ref;
28182 : s2_is_unicode = 1;
28183 : } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
28184 : owned_ref = PyUnicode_FromObject(s1);
28185 : if (unlikely(!owned_ref))
28186 : return -1;
28187 : s1 = owned_ref;
28188 : s1_is_unicode = 1;
28189 : } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
28190 : return __Pyx_PyBytes_Equals(s1, s2, equals);
28191 : }
28192 : #endif
28193 7 : if (s1_is_unicode & s2_is_unicode) {
28194 7 : Py_ssize_t length;
28195 7 : int kind;
28196 7 : void *data1, *data2;
28197 7 : if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
28198 : return -1;
28199 7 : length = __Pyx_PyUnicode_GET_LENGTH(s1);
28200 7 : if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
28201 0 : goto return_ne;
28202 : }
28203 : #if CYTHON_USE_UNICODE_INTERNALS
28204 : {
28205 7 : Py_hash_t hash1, hash2;
28206 : #if CYTHON_PEP393_ENABLED
28207 7 : hash1 = ((PyASCIIObject*)s1)->hash;
28208 7 : hash2 = ((PyASCIIObject*)s2)->hash;
28209 : #else
28210 : hash1 = ((PyUnicodeObject*)s1)->hash;
28211 : hash2 = ((PyUnicodeObject*)s2)->hash;
28212 : #endif
28213 7 : if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
28214 7 : goto return_ne;
28215 : }
28216 : }
28217 : #endif
28218 0 : kind = __Pyx_PyUnicode_KIND(s1);
28219 0 : if (kind != __Pyx_PyUnicode_KIND(s2)) {
28220 0 : goto return_ne;
28221 : }
28222 0 : data1 = __Pyx_PyUnicode_DATA(s1);
28223 0 : data2 = __Pyx_PyUnicode_DATA(s2);
28224 0 : if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
28225 0 : goto return_ne;
28226 0 : } else if (length == 1) {
28227 0 : goto return_eq;
28228 : } else {
28229 0 : int result = memcmp(data1, data2, (size_t)(length * kind));
28230 : #if PY_MAJOR_VERSION < 3
28231 : Py_XDECREF(owned_ref);
28232 : #endif
28233 0 : return (equals == Py_EQ) ? (result == 0) : (result != 0);
28234 : }
28235 0 : } else if ((s1 == Py_None) & s2_is_unicode) {
28236 0 : goto return_ne;
28237 0 : } else if ((s2 == Py_None) & s1_is_unicode) {
28238 0 : goto return_ne;
28239 : } else {
28240 0 : int result;
28241 0 : PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
28242 : #if PY_MAJOR_VERSION < 3
28243 : Py_XDECREF(owned_ref);
28244 : #endif
28245 0 : if (!py_result)
28246 : return -1;
28247 0 : result = __Pyx_PyObject_IsTrue(py_result);
28248 0 : Py_DECREF(py_result);
28249 0 : return result;
28250 : }
28251 7 : return_eq:
28252 : #if PY_MAJOR_VERSION < 3
28253 : Py_XDECREF(owned_ref);
28254 : #endif
28255 7 : return (equals == Py_EQ);
28256 7 : return_ne:
28257 : #if PY_MAJOR_VERSION < 3
28258 : Py_XDECREF(owned_ref);
28259 : #endif
28260 7 : return (equals == Py_NE);
28261 : #endif
28262 : }
28263 :
28264 : /* fastcall */
28265 : #if CYTHON_METH_FASTCALL
28266 0 : static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
28267 : {
28268 0 : Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames);
28269 0 : for (i = 0; i < n; i++)
28270 : {
28271 0 : if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i];
28272 : }
28273 0 : for (i = 0; i < n; i++)
28274 : {
28275 0 : int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
28276 0 : if (unlikely(eq != 0)) {
28277 0 : if (unlikely(eq < 0)) return NULL;
28278 0 : return kwvalues[i];
28279 : }
28280 : }
28281 : return NULL;
28282 : }
28283 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
28284 : CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
28285 : Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
28286 : PyObject *dict;
28287 : dict = PyDict_New();
28288 : if (unlikely(!dict))
28289 : return NULL;
28290 : for (i=0; i<nkwargs; i++) {
28291 : PyObject *key = PyTuple_GET_ITEM(kwnames, i);
28292 : if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
28293 : goto bad;
28294 : }
28295 : return dict;
28296 : bad:
28297 : Py_DECREF(dict);
28298 : return NULL;
28299 : }
28300 : #endif
28301 : #endif
28302 :
28303 : /* RaiseArgTupleInvalid */
28304 0 : static void __Pyx_RaiseArgtupleInvalid(
28305 : const char* func_name,
28306 : int exact,
28307 : Py_ssize_t num_min,
28308 : Py_ssize_t num_max,
28309 : Py_ssize_t num_found)
28310 : {
28311 0 : Py_ssize_t num_expected;
28312 0 : const char *more_or_less;
28313 0 : if (num_found < num_min) {
28314 : num_expected = num_min;
28315 : more_or_less = "at least";
28316 : } else {
28317 0 : num_expected = num_max;
28318 0 : more_or_less = "at most";
28319 : }
28320 0 : if (exact) {
28321 0 : more_or_less = "exactly";
28322 : }
28323 0 : PyErr_Format(PyExc_TypeError,
28324 : "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
28325 : func_name, more_or_less, num_expected,
28326 : (num_expected == 1) ? "" : "s", num_found);
28327 0 : }
28328 :
28329 : /* RaiseDoubleKeywords */
28330 0 : static void __Pyx_RaiseDoubleKeywordsError(
28331 : const char* func_name,
28332 : PyObject* kw_name)
28333 : {
28334 0 : PyErr_Format(PyExc_TypeError,
28335 : #if PY_MAJOR_VERSION >= 3
28336 : "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
28337 : #else
28338 : "%s() got multiple values for keyword argument '%s'", func_name,
28339 : PyString_AsString(kw_name));
28340 : #endif
28341 : }
28342 :
28343 : /* ParseKeywords */
28344 0 : static int __Pyx_ParseOptionalKeywords(
28345 : PyObject *kwds,
28346 : PyObject *const *kwvalues,
28347 : PyObject **argnames[],
28348 : PyObject *kwds2,
28349 : PyObject *values[],
28350 : Py_ssize_t num_pos_args,
28351 : const char* function_name)
28352 : {
28353 0 : PyObject *key = 0, *value = 0;
28354 0 : Py_ssize_t pos = 0;
28355 0 : PyObject*** name;
28356 0 : PyObject*** first_kw_arg = argnames + num_pos_args;
28357 0 : int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds));
28358 0 : while (1) {
28359 0 : Py_XDECREF(key); key = NULL;
28360 0 : Py_XDECREF(value); value = NULL;
28361 0 : if (kwds_is_tuple) {
28362 0 : Py_ssize_t size;
28363 : #if CYTHON_ASSUME_SAFE_MACROS
28364 0 : size = PyTuple_GET_SIZE(kwds);
28365 : #else
28366 : size = PyTuple_Size(kwds);
28367 : if (size < 0) goto bad;
28368 : #endif
28369 0 : if (pos >= size) break;
28370 : #if CYTHON_AVOID_BORROWED_REFS
28371 : key = __Pyx_PySequence_ITEM(kwds, pos);
28372 : if (!key) goto bad;
28373 : #elif CYTHON_ASSUME_SAFE_MACROS
28374 0 : key = PyTuple_GET_ITEM(kwds, pos);
28375 : #else
28376 : key = PyTuple_GetItem(kwds, pos);
28377 : if (!key) goto bad;
28378 : #endif
28379 0 : value = kwvalues[pos];
28380 0 : pos++;
28381 : }
28382 : else
28383 : {
28384 0 : if (!PyDict_Next(kwds, &pos, &key, &value)) break;
28385 : #if CYTHON_AVOID_BORROWED_REFS
28386 : Py_INCREF(key);
28387 : #endif
28388 : }
28389 0 : name = first_kw_arg;
28390 0 : while (*name && (**name != key)) name++;
28391 0 : if (*name) {
28392 0 : values[name-argnames] = value;
28393 : #if CYTHON_AVOID_BORROWED_REFS
28394 : Py_INCREF(value);
28395 : Py_DECREF(key);
28396 : #endif
28397 0 : key = NULL;
28398 0 : value = NULL;
28399 0 : continue;
28400 : }
28401 : #if !CYTHON_AVOID_BORROWED_REFS
28402 0 : Py_INCREF(key);
28403 : #endif
28404 0 : Py_INCREF(value);
28405 0 : name = first_kw_arg;
28406 : #if PY_MAJOR_VERSION < 3
28407 : if (likely(PyString_Check(key))) {
28408 : while (*name) {
28409 : if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
28410 : && _PyString_Eq(**name, key)) {
28411 : values[name-argnames] = value;
28412 : #if CYTHON_AVOID_BORROWED_REFS
28413 : value = NULL;
28414 : #endif
28415 : break;
28416 : }
28417 : name++;
28418 : }
28419 : if (*name) continue;
28420 : else {
28421 : PyObject*** argname = argnames;
28422 : while (argname != first_kw_arg) {
28423 : if ((**argname == key) || (
28424 : (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
28425 : && _PyString_Eq(**argname, key))) {
28426 : goto arg_passed_twice;
28427 : }
28428 : argname++;
28429 : }
28430 : }
28431 : } else
28432 : #endif
28433 0 : if (likely(PyUnicode_Check(key))) {
28434 0 : while (*name) {
28435 0 : int cmp = (
28436 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
28437 0 : (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
28438 : #endif
28439 0 : PyUnicode_Compare(**name, key)
28440 : );
28441 0 : if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
28442 0 : if (cmp == 0) {
28443 0 : values[name-argnames] = value;
28444 : #if CYTHON_AVOID_BORROWED_REFS
28445 : value = NULL;
28446 : #endif
28447 0 : break;
28448 : }
28449 0 : name++;
28450 : }
28451 0 : if (*name) continue;
28452 : else {
28453 : PyObject*** argname = argnames;
28454 0 : while (argname != first_kw_arg) {
28455 0 : int cmp = (**argname == key) ? 0 :
28456 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
28457 0 : (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
28458 : #endif
28459 0 : PyUnicode_Compare(**argname, key);
28460 0 : if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
28461 0 : if (cmp == 0) goto arg_passed_twice;
28462 0 : argname++;
28463 : }
28464 : }
28465 : } else
28466 0 : goto invalid_keyword_type;
28467 0 : if (kwds2) {
28468 0 : if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
28469 : } else {
28470 0 : goto invalid_keyword;
28471 : }
28472 : }
28473 0 : Py_XDECREF(key);
28474 0 : Py_XDECREF(value);
28475 0 : return 0;
28476 0 : arg_passed_twice:
28477 0 : __Pyx_RaiseDoubleKeywordsError(function_name, key);
28478 0 : goto bad;
28479 0 : invalid_keyword_type:
28480 0 : PyErr_Format(PyExc_TypeError,
28481 : "%.200s() keywords must be strings", function_name);
28482 0 : goto bad;
28483 0 : invalid_keyword:
28484 : #if PY_MAJOR_VERSION < 3
28485 : PyErr_Format(PyExc_TypeError,
28486 : "%.200s() got an unexpected keyword argument '%.200s'",
28487 : function_name, PyString_AsString(key));
28488 : #else
28489 0 : PyErr_Format(PyExc_TypeError,
28490 : "%s() got an unexpected keyword argument '%U'",
28491 : function_name, key);
28492 : #endif
28493 0 : bad:
28494 0 : Py_XDECREF(key);
28495 0 : Py_XDECREF(value);
28496 0 : return -1;
28497 : }
28498 :
28499 : /* ArgTypeTest */
28500 0 : static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
28501 : {
28502 0 : __Pyx_TypeName type_name;
28503 0 : __Pyx_TypeName obj_type_name;
28504 0 : if (unlikely(!type)) {
28505 0 : PyErr_SetString(PyExc_SystemError, "Missing type object");
28506 0 : return 0;
28507 : }
28508 0 : else if (exact) {
28509 : #if PY_MAJOR_VERSION == 2
28510 : if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
28511 : #endif
28512 : }
28513 : else {
28514 0 : if (likely(__Pyx_TypeCheck(obj, type))) return 1;
28515 : }
28516 0 : type_name = __Pyx_PyType_GetName(type);
28517 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
28518 0 : PyErr_Format(PyExc_TypeError,
28519 : "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
28520 : ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name);
28521 0 : __Pyx_DECREF_TypeName(type_name);
28522 0 : __Pyx_DECREF_TypeName(obj_type_name);
28523 0 : return 0;
28524 : }
28525 :
28526 : /* RaiseException */
28527 : #if PY_MAJOR_VERSION < 3
28528 : static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
28529 : __Pyx_PyThreadState_declare
28530 : CYTHON_UNUSED_VAR(cause);
28531 : Py_XINCREF(type);
28532 : if (!value || value == Py_None)
28533 : value = NULL;
28534 : else
28535 : Py_INCREF(value);
28536 : if (!tb || tb == Py_None)
28537 : tb = NULL;
28538 : else {
28539 : Py_INCREF(tb);
28540 : if (!PyTraceBack_Check(tb)) {
28541 : PyErr_SetString(PyExc_TypeError,
28542 : "raise: arg 3 must be a traceback or None");
28543 : goto raise_error;
28544 : }
28545 : }
28546 : if (PyType_Check(type)) {
28547 : #if CYTHON_COMPILING_IN_PYPY
28548 : if (!value) {
28549 : Py_INCREF(Py_None);
28550 : value = Py_None;
28551 : }
28552 : #endif
28553 : PyErr_NormalizeException(&type, &value, &tb);
28554 : } else {
28555 : if (value) {
28556 : PyErr_SetString(PyExc_TypeError,
28557 : "instance exception may not have a separate value");
28558 : goto raise_error;
28559 : }
28560 : value = type;
28561 : type = (PyObject*) Py_TYPE(type);
28562 : Py_INCREF(type);
28563 : if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
28564 : PyErr_SetString(PyExc_TypeError,
28565 : "raise: exception class must be a subclass of BaseException");
28566 : goto raise_error;
28567 : }
28568 : }
28569 : __Pyx_PyThreadState_assign
28570 : __Pyx_ErrRestore(type, value, tb);
28571 : return;
28572 : raise_error:
28573 : Py_XDECREF(value);
28574 : Py_XDECREF(type);
28575 : Py_XDECREF(tb);
28576 : return;
28577 : }
28578 : #else
28579 0 : static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
28580 0 : PyObject* owned_instance = NULL;
28581 0 : if (tb == Py_None) {
28582 : tb = 0;
28583 0 : } else if (tb && !PyTraceBack_Check(tb)) {
28584 0 : PyErr_SetString(PyExc_TypeError,
28585 : "raise: arg 3 must be a traceback or None");
28586 0 : goto bad;
28587 : }
28588 0 : if (value == Py_None)
28589 0 : value = 0;
28590 0 : if (PyExceptionInstance_Check(type)) {
28591 0 : if (value) {
28592 0 : PyErr_SetString(PyExc_TypeError,
28593 : "instance exception may not have a separate value");
28594 0 : goto bad;
28595 : }
28596 : value = type;
28597 : type = (PyObject*) Py_TYPE(value);
28598 0 : } else if (PyExceptionClass_Check(type)) {
28599 0 : PyObject *instance_class = NULL;
28600 0 : if (value && PyExceptionInstance_Check(value)) {
28601 0 : instance_class = (PyObject*) Py_TYPE(value);
28602 0 : if (instance_class != type) {
28603 0 : int is_subclass = PyObject_IsSubclass(instance_class, type);
28604 0 : if (!is_subclass) {
28605 : instance_class = NULL;
28606 0 : } else if (unlikely(is_subclass == -1)) {
28607 0 : goto bad;
28608 : } else {
28609 : type = instance_class;
28610 : }
28611 : }
28612 : }
28613 : if (!instance_class) {
28614 0 : PyObject *args;
28615 0 : if (!value)
28616 0 : args = PyTuple_New(0);
28617 0 : else if (PyTuple_Check(value)) {
28618 0 : Py_INCREF(value);
28619 0 : args = value;
28620 : } else
28621 0 : args = PyTuple_Pack(1, value);
28622 0 : if (!args)
28623 0 : goto bad;
28624 0 : owned_instance = PyObject_Call(type, args, NULL);
28625 0 : Py_DECREF(args);
28626 0 : if (!owned_instance)
28627 0 : goto bad;
28628 0 : value = owned_instance;
28629 0 : if (!PyExceptionInstance_Check(value)) {
28630 0 : PyErr_Format(PyExc_TypeError,
28631 : "calling %R should have returned an instance of "
28632 : "BaseException, not %R",
28633 : type, Py_TYPE(value));
28634 0 : goto bad;
28635 : }
28636 : }
28637 : } else {
28638 0 : PyErr_SetString(PyExc_TypeError,
28639 : "raise: exception class must be a subclass of BaseException");
28640 0 : goto bad;
28641 : }
28642 0 : if (cause) {
28643 0 : PyObject *fixed_cause;
28644 0 : if (cause == Py_None) {
28645 : fixed_cause = NULL;
28646 0 : } else if (PyExceptionClass_Check(cause)) {
28647 0 : fixed_cause = PyObject_CallObject(cause, NULL);
28648 0 : if (fixed_cause == NULL)
28649 0 : goto bad;
28650 0 : } else if (PyExceptionInstance_Check(cause)) {
28651 0 : fixed_cause = cause;
28652 0 : Py_INCREF(fixed_cause);
28653 : } else {
28654 0 : PyErr_SetString(PyExc_TypeError,
28655 : "exception causes must derive from "
28656 : "BaseException");
28657 0 : goto bad;
28658 : }
28659 0 : PyException_SetCause(value, fixed_cause);
28660 : }
28661 0 : PyErr_SetObject(type, value);
28662 0 : if (tb) {
28663 : #if PY_VERSION_HEX >= 0x030C00A6
28664 0 : PyException_SetTraceback(value, tb);
28665 : #elif CYTHON_FAST_THREAD_STATE
28666 : PyThreadState *tstate = __Pyx_PyThreadState_Current;
28667 : PyObject* tmp_tb = tstate->curexc_traceback;
28668 : if (tb != tmp_tb) {
28669 : Py_INCREF(tb);
28670 : tstate->curexc_traceback = tb;
28671 : Py_XDECREF(tmp_tb);
28672 : }
28673 : #else
28674 : PyObject *tmp_type, *tmp_value, *tmp_tb;
28675 : PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
28676 : Py_INCREF(tb);
28677 : PyErr_Restore(tmp_type, tmp_value, tb);
28678 : Py_XDECREF(tmp_tb);
28679 : #endif
28680 : }
28681 0 : bad:
28682 0 : Py_XDECREF(owned_instance);
28683 0 : return;
28684 : }
28685 : #endif
28686 :
28687 : /* PyFunctionFastCall */
28688 : #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
28689 : static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
28690 : PyObject *globals) {
28691 : PyFrameObject *f;
28692 : PyThreadState *tstate = __Pyx_PyThreadState_Current;
28693 : PyObject **fastlocals;
28694 : Py_ssize_t i;
28695 : PyObject *result;
28696 : assert(globals != NULL);
28697 : /* XXX Perhaps we should create a specialized
28698 : PyFrame_New() that doesn't take locals, but does
28699 : take builtins without sanity checking them.
28700 : */
28701 : assert(tstate != NULL);
28702 : f = PyFrame_New(tstate, co, globals, NULL);
28703 : if (f == NULL) {
28704 : return NULL;
28705 : }
28706 : fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
28707 : for (i = 0; i < na; i++) {
28708 : Py_INCREF(*args);
28709 : fastlocals[i] = *args++;
28710 : }
28711 : result = PyEval_EvalFrameEx(f,0);
28712 : ++tstate->recursion_depth;
28713 : Py_DECREF(f);
28714 : --tstate->recursion_depth;
28715 : return result;
28716 : }
28717 : static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
28718 : PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
28719 : PyObject *globals = PyFunction_GET_GLOBALS(func);
28720 : PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
28721 : PyObject *closure;
28722 : #if PY_MAJOR_VERSION >= 3
28723 : PyObject *kwdefs;
28724 : #endif
28725 : PyObject *kwtuple, **k;
28726 : PyObject **d;
28727 : Py_ssize_t nd;
28728 : Py_ssize_t nk;
28729 : PyObject *result;
28730 : assert(kwargs == NULL || PyDict_Check(kwargs));
28731 : nk = kwargs ? PyDict_Size(kwargs) : 0;
28732 : #if PY_MAJOR_VERSION < 3
28733 : if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
28734 : return NULL;
28735 : }
28736 : #else
28737 : if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
28738 : return NULL;
28739 : }
28740 : #endif
28741 : if (
28742 : #if PY_MAJOR_VERSION >= 3
28743 : co->co_kwonlyargcount == 0 &&
28744 : #endif
28745 : likely(kwargs == NULL || nk == 0) &&
28746 : co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
28747 : if (argdefs == NULL && co->co_argcount == nargs) {
28748 : result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
28749 : goto done;
28750 : }
28751 : else if (nargs == 0 && argdefs != NULL
28752 : && co->co_argcount == Py_SIZE(argdefs)) {
28753 : /* function called with no arguments, but all parameters have
28754 : a default value: use default values as arguments .*/
28755 : args = &PyTuple_GET_ITEM(argdefs, 0);
28756 : result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
28757 : goto done;
28758 : }
28759 : }
28760 : if (kwargs != NULL) {
28761 : Py_ssize_t pos, i;
28762 : kwtuple = PyTuple_New(2 * nk);
28763 : if (kwtuple == NULL) {
28764 : result = NULL;
28765 : goto done;
28766 : }
28767 : k = &PyTuple_GET_ITEM(kwtuple, 0);
28768 : pos = i = 0;
28769 : while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
28770 : Py_INCREF(k[i]);
28771 : Py_INCREF(k[i+1]);
28772 : i += 2;
28773 : }
28774 : nk = i / 2;
28775 : }
28776 : else {
28777 : kwtuple = NULL;
28778 : k = NULL;
28779 : }
28780 : closure = PyFunction_GET_CLOSURE(func);
28781 : #if PY_MAJOR_VERSION >= 3
28782 : kwdefs = PyFunction_GET_KW_DEFAULTS(func);
28783 : #endif
28784 : if (argdefs != NULL) {
28785 : d = &PyTuple_GET_ITEM(argdefs, 0);
28786 : nd = Py_SIZE(argdefs);
28787 : }
28788 : else {
28789 : d = NULL;
28790 : nd = 0;
28791 : }
28792 : #if PY_MAJOR_VERSION >= 3
28793 : result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
28794 : args, (int)nargs,
28795 : k, (int)nk,
28796 : d, (int)nd, kwdefs, closure);
28797 : #else
28798 : result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
28799 : args, (int)nargs,
28800 : k, (int)nk,
28801 : d, (int)nd, closure);
28802 : #endif
28803 : Py_XDECREF(kwtuple);
28804 : done:
28805 : Py_LeaveRecursiveCall();
28806 : return result;
28807 : }
28808 : #endif
28809 :
28810 : /* PyObjectCall */
28811 : #if CYTHON_COMPILING_IN_CPYTHON
28812 30 : static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
28813 30 : PyObject *result;
28814 30 : ternaryfunc call = Py_TYPE(func)->tp_call;
28815 30 : if (unlikely(!call))
28816 0 : return PyObject_Call(func, arg, kw);
28817 : #if PY_MAJOR_VERSION < 3
28818 : if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
28819 : return NULL;
28820 : #else
28821 30 : if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
28822 : return NULL;
28823 : #endif
28824 30 : result = (*call)(func, arg, kw);
28825 30 : Py_LeaveRecursiveCall();
28826 30 : if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
28827 0 : PyErr_SetString(
28828 : PyExc_SystemError,
28829 : "NULL result without error in PyObject_Call");
28830 : }
28831 : return result;
28832 : }
28833 : #endif
28834 :
28835 : /* PyObjectCallMethO */
28836 : #if CYTHON_COMPILING_IN_CPYTHON
28837 0 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
28838 0 : PyObject *self, *result;
28839 0 : PyCFunction cfunc;
28840 0 : cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
28841 0 : self = __Pyx_CyOrPyCFunction_GET_SELF(func);
28842 : #if PY_MAJOR_VERSION < 3
28843 : if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
28844 : return NULL;
28845 : #else
28846 0 : if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
28847 : return NULL;
28848 : #endif
28849 0 : result = cfunc(self, arg);
28850 0 : Py_LeaveRecursiveCall();
28851 0 : if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
28852 0 : PyErr_SetString(
28853 : PyExc_SystemError,
28854 : "NULL result without error in PyObject_Call");
28855 : }
28856 : return result;
28857 : }
28858 : #endif
28859 :
28860 : /* PyObjectFastCall */
28861 : #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
28862 : static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) {
28863 : PyObject *argstuple;
28864 : PyObject *result = 0;
28865 : size_t i;
28866 : argstuple = PyTuple_New((Py_ssize_t)nargs);
28867 : if (unlikely(!argstuple)) return NULL;
28868 : for (i = 0; i < nargs; i++) {
28869 : Py_INCREF(args[i]);
28870 : if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
28871 : }
28872 : result = __Pyx_PyObject_Call(func, argstuple, kwargs);
28873 : bad:
28874 : Py_DECREF(argstuple);
28875 : return result;
28876 : }
28877 : #endif
28878 50 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) {
28879 50 : Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
28880 : #if CYTHON_COMPILING_IN_CPYTHON
28881 50 : if (nargs == 0 && kwargs == NULL) {
28882 0 : if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
28883 0 : return __Pyx_PyObject_CallMethO(func, NULL);
28884 : }
28885 50 : else if (nargs == 1 && kwargs == NULL) {
28886 47 : if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
28887 0 : return __Pyx_PyObject_CallMethO(func, args[0]);
28888 : }
28889 : #endif
28890 : #if PY_VERSION_HEX < 0x030800B1
28891 : #if CYTHON_FAST_PYCCALL
28892 : if (PyCFunction_Check(func)) {
28893 : if (kwargs) {
28894 : return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
28895 : } else {
28896 : return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
28897 : }
28898 : }
28899 : #if PY_VERSION_HEX >= 0x030700A1
28900 : if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
28901 : return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
28902 : }
28903 : #endif
28904 : #endif
28905 : #if CYTHON_FAST_PYCALL
28906 : if (PyFunction_Check(func)) {
28907 : return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
28908 : }
28909 : #endif
28910 : #endif
28911 50 : if (kwargs == NULL) {
28912 : #if CYTHON_VECTORCALL
28913 : #if PY_VERSION_HEX < 0x03090000
28914 : vectorcallfunc f = _PyVectorcall_Function(func);
28915 : #else
28916 50 : vectorcallfunc f = PyVectorcall_Function(func);
28917 : #endif
28918 50 : if (f) {
28919 44 : return f(func, args, (size_t)nargs, NULL);
28920 : }
28921 : #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
28922 : if (__Pyx_CyFunction_CheckExact(func)) {
28923 : __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
28924 : if (f) return f(func, args, (size_t)nargs, NULL);
28925 : }
28926 : #endif
28927 : }
28928 6 : if (nargs == 0) {
28929 0 : return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
28930 : }
28931 : #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
28932 6 : return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
28933 : #else
28934 : return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
28935 : #endif
28936 : }
28937 :
28938 : /* RaiseUnexpectedTypeError */
28939 : static int
28940 0 : __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
28941 : {
28942 0 : __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
28943 0 : PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
28944 : expected, obj_type_name);
28945 0 : __Pyx_DECREF_TypeName(obj_type_name);
28946 0 : return 0;
28947 : }
28948 :
28949 : /* CIntToDigits */
28950 : static const char DIGIT_PAIRS_10[2*10*10+1] = {
28951 : "00010203040506070809"
28952 : "10111213141516171819"
28953 : "20212223242526272829"
28954 : "30313233343536373839"
28955 : "40414243444546474849"
28956 : "50515253545556575859"
28957 : "60616263646566676869"
28958 : "70717273747576777879"
28959 : "80818283848586878889"
28960 : "90919293949596979899"
28961 : };
28962 : static const char DIGIT_PAIRS_8[2*8*8+1] = {
28963 : "0001020304050607"
28964 : "1011121314151617"
28965 : "2021222324252627"
28966 : "3031323334353637"
28967 : "4041424344454647"
28968 : "5051525354555657"
28969 : "6061626364656667"
28970 : "7071727374757677"
28971 : };
28972 : static const char DIGITS_HEX[2*16+1] = {
28973 : "0123456789abcdef"
28974 : "0123456789ABCDEF"
28975 : };
28976 :
28977 : /* BuildPyUnicode */
28978 0 : static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
28979 : int prepend_sign, char padding_char) {
28980 0 : PyObject *uval;
28981 0 : Py_ssize_t uoffset = ulength - clength;
28982 : #if CYTHON_USE_UNICODE_INTERNALS
28983 0 : Py_ssize_t i;
28984 : #if CYTHON_PEP393_ENABLED
28985 0 : void *udata;
28986 0 : uval = PyUnicode_New(ulength, 127);
28987 0 : if (unlikely(!uval)) return NULL;
28988 0 : udata = PyUnicode_DATA(uval);
28989 : #else
28990 : Py_UNICODE *udata;
28991 : uval = PyUnicode_FromUnicode(NULL, ulength);
28992 : if (unlikely(!uval)) return NULL;
28993 : udata = PyUnicode_AS_UNICODE(uval);
28994 : #endif
28995 0 : if (uoffset > 0) {
28996 0 : i = 0;
28997 0 : if (prepend_sign) {
28998 0 : __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
28999 0 : i++;
29000 : }
29001 0 : for (; i < uoffset; i++) {
29002 0 : __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
29003 : }
29004 : }
29005 0 : for (i=0; i < clength; i++) {
29006 0 : __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
29007 : }
29008 : #else
29009 : {
29010 : PyObject *sign = NULL, *padding = NULL;
29011 : uval = NULL;
29012 : if (uoffset > 0) {
29013 : prepend_sign = !!prepend_sign;
29014 : if (uoffset > prepend_sign) {
29015 : padding = PyUnicode_FromOrdinal(padding_char);
29016 : if (likely(padding) && uoffset > prepend_sign + 1) {
29017 : PyObject *tmp;
29018 : PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign);
29019 : if (unlikely(!repeat)) goto done_or_error;
29020 : tmp = PyNumber_Multiply(padding, repeat);
29021 : Py_DECREF(repeat);
29022 : Py_DECREF(padding);
29023 : padding = tmp;
29024 : }
29025 : if (unlikely(!padding)) goto done_or_error;
29026 : }
29027 : if (prepend_sign) {
29028 : sign = PyUnicode_FromOrdinal('-');
29029 : if (unlikely(!sign)) goto done_or_error;
29030 : }
29031 : }
29032 : uval = PyUnicode_DecodeASCII(chars, clength, NULL);
29033 : if (likely(uval) && padding) {
29034 : PyObject *tmp = PyNumber_Add(padding, uval);
29035 : Py_DECREF(uval);
29036 : uval = tmp;
29037 : }
29038 : if (likely(uval) && sign) {
29039 : PyObject *tmp = PyNumber_Add(sign, uval);
29040 : Py_DECREF(uval);
29041 : uval = tmp;
29042 : }
29043 : done_or_error:
29044 : Py_XDECREF(padding);
29045 : Py_XDECREF(sign);
29046 : }
29047 : #endif
29048 : return uval;
29049 : }
29050 :
29051 : /* CIntToPyUnicode */
29052 0 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
29053 0 : char digits[sizeof(int)*3+2];
29054 0 : char *dpos, *end = digits + sizeof(int)*3+2;
29055 0 : const char *hex_digits = DIGITS_HEX;
29056 0 : Py_ssize_t length, ulength;
29057 0 : int prepend_sign, last_one_off;
29058 0 : int remaining;
29059 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29060 : #pragma GCC diagnostic push
29061 : #pragma GCC diagnostic ignored "-Wconversion"
29062 : #endif
29063 0 : const int neg_one = (int) -1, const_zero = (int) 0;
29064 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29065 : #pragma GCC diagnostic pop
29066 : #endif
29067 0 : const int is_unsigned = neg_one > const_zero;
29068 0 : if (format_char == 'X') {
29069 0 : hex_digits += 16;
29070 0 : format_char = 'x';
29071 : }
29072 0 : remaining = value;
29073 0 : last_one_off = 0;
29074 0 : dpos = end;
29075 0 : do {
29076 0 : int digit_pos;
29077 0 : switch (format_char) {
29078 0 : case 'o':
29079 0 : digit_pos = abs((int)(remaining % (8*8)));
29080 0 : remaining = (int) (remaining / (8*8));
29081 0 : dpos -= 2;
29082 0 : memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
29083 0 : last_one_off = (digit_pos < 8);
29084 0 : break;
29085 0 : case 'd':
29086 0 : digit_pos = abs((int)(remaining % (10*10)));
29087 0 : remaining = (int) (remaining / (10*10));
29088 0 : dpos -= 2;
29089 0 : memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
29090 0 : last_one_off = (digit_pos < 10);
29091 0 : break;
29092 0 : case 'x':
29093 0 : *(--dpos) = hex_digits[abs((int)(remaining % 16))];
29094 0 : remaining = (int) (remaining / 16);
29095 0 : break;
29096 : default:
29097 : assert(0);
29098 : break;
29099 : }
29100 0 : } while (unlikely(remaining != 0));
29101 0 : assert(!last_one_off || *dpos == '0');
29102 0 : dpos += last_one_off;
29103 0 : length = end - dpos;
29104 0 : ulength = length;
29105 0 : prepend_sign = 0;
29106 0 : if (!is_unsigned && value <= neg_one) {
29107 0 : if (padding_char == ' ' || width <= length + 1) {
29108 0 : *(--dpos) = '-';
29109 0 : ++length;
29110 : } else {
29111 : prepend_sign = 1;
29112 : }
29113 0 : ++ulength;
29114 : }
29115 0 : if (width > ulength) {
29116 : ulength = width;
29117 : }
29118 0 : if (ulength == 1) {
29119 0 : return PyUnicode_FromOrdinal(*dpos);
29120 : }
29121 0 : return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
29122 : }
29123 :
29124 : /* CIntToPyUnicode */
29125 0 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
29126 0 : char digits[sizeof(Py_ssize_t)*3+2];
29127 0 : char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
29128 0 : const char *hex_digits = DIGITS_HEX;
29129 0 : Py_ssize_t length, ulength;
29130 0 : int prepend_sign, last_one_off;
29131 0 : Py_ssize_t remaining;
29132 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29133 : #pragma GCC diagnostic push
29134 : #pragma GCC diagnostic ignored "-Wconversion"
29135 : #endif
29136 0 : const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
29137 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29138 : #pragma GCC diagnostic pop
29139 : #endif
29140 0 : const int is_unsigned = neg_one > const_zero;
29141 0 : if (format_char == 'X') {
29142 0 : hex_digits += 16;
29143 0 : format_char = 'x';
29144 : }
29145 0 : remaining = value;
29146 0 : last_one_off = 0;
29147 0 : dpos = end;
29148 0 : do {
29149 0 : int digit_pos;
29150 0 : switch (format_char) {
29151 0 : case 'o':
29152 0 : digit_pos = abs((int)(remaining % (8*8)));
29153 0 : remaining = (Py_ssize_t) (remaining / (8*8));
29154 0 : dpos -= 2;
29155 0 : memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
29156 0 : last_one_off = (digit_pos < 8);
29157 0 : break;
29158 0 : case 'd':
29159 0 : digit_pos = abs((int)(remaining % (10*10)));
29160 0 : remaining = (Py_ssize_t) (remaining / (10*10));
29161 0 : dpos -= 2;
29162 0 : memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
29163 0 : last_one_off = (digit_pos < 10);
29164 0 : break;
29165 0 : case 'x':
29166 0 : *(--dpos) = hex_digits[abs((int)(remaining % 16))];
29167 0 : remaining = (Py_ssize_t) (remaining / 16);
29168 0 : break;
29169 : default:
29170 : assert(0);
29171 : break;
29172 : }
29173 0 : } while (unlikely(remaining != 0));
29174 0 : assert(!last_one_off || *dpos == '0');
29175 0 : dpos += last_one_off;
29176 0 : length = end - dpos;
29177 0 : ulength = length;
29178 0 : prepend_sign = 0;
29179 0 : if (!is_unsigned && value <= neg_one) {
29180 0 : if (padding_char == ' ' || width <= length + 1) {
29181 0 : *(--dpos) = '-';
29182 0 : ++length;
29183 : } else {
29184 : prepend_sign = 1;
29185 : }
29186 0 : ++ulength;
29187 : }
29188 0 : if (width > ulength) {
29189 : ulength = width;
29190 : }
29191 0 : if (ulength == 1) {
29192 0 : return PyUnicode_FromOrdinal(*dpos);
29193 : }
29194 0 : return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
29195 : }
29196 :
29197 : /* JoinPyUnicode */
29198 0 : static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
29199 : Py_UCS4 max_char) {
29200 : #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29201 0 : PyObject *result_uval;
29202 0 : int result_ukind, kind_shift;
29203 0 : Py_ssize_t i, char_pos;
29204 0 : void *result_udata;
29205 0 : CYTHON_MAYBE_UNUSED_VAR(max_char);
29206 : #if CYTHON_PEP393_ENABLED
29207 0 : result_uval = PyUnicode_New(result_ulength, max_char);
29208 0 : if (unlikely(!result_uval)) return NULL;
29209 0 : result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
29210 0 : kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
29211 0 : result_udata = PyUnicode_DATA(result_uval);
29212 : #else
29213 : result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
29214 : if (unlikely(!result_uval)) return NULL;
29215 : result_ukind = sizeof(Py_UNICODE);
29216 : kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1;
29217 : result_udata = PyUnicode_AS_UNICODE(result_uval);
29218 : #endif
29219 0 : assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
29220 0 : char_pos = 0;
29221 0 : for (i=0; i < value_count; i++) {
29222 0 : int ukind;
29223 0 : Py_ssize_t ulength;
29224 0 : void *udata;
29225 0 : PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
29226 0 : if (unlikely(__Pyx_PyUnicode_READY(uval)))
29227 : goto bad;
29228 0 : ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
29229 0 : if (unlikely(!ulength))
29230 0 : continue;
29231 0 : if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
29232 0 : goto overflow;
29233 0 : ukind = __Pyx_PyUnicode_KIND(uval);
29234 0 : udata = __Pyx_PyUnicode_DATA(uval);
29235 0 : if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
29236 0 : memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
29237 : } else {
29238 : #if PY_VERSION_HEX >= 0x030d0000
29239 : if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
29240 : #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
29241 0 : _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
29242 : #else
29243 : Py_ssize_t j;
29244 : for (j=0; j < ulength; j++) {
29245 : Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
29246 : __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
29247 : }
29248 : #endif
29249 : }
29250 0 : char_pos += ulength;
29251 : }
29252 : return result_uval;
29253 0 : overflow:
29254 0 : PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
29255 0 : bad:
29256 0 : Py_DECREF(result_uval);
29257 : return NULL;
29258 : #else
29259 : CYTHON_UNUSED_VAR(max_char);
29260 : CYTHON_UNUSED_VAR(result_ulength);
29261 : CYTHON_UNUSED_VAR(value_count);
29262 : return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
29263 : #endif
29264 : }
29265 :
29266 : /* GetAttr */
29267 0 : static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
29268 : #if CYTHON_USE_TYPE_SLOTS
29269 : #if PY_MAJOR_VERSION >= 3
29270 0 : if (likely(PyUnicode_Check(n)))
29271 : #else
29272 : if (likely(PyString_Check(n)))
29273 : #endif
29274 0 : return __Pyx_PyObject_GetAttrStr(o, n);
29275 : #endif
29276 0 : return PyObject_GetAttr(o, n);
29277 : }
29278 :
29279 : /* GetItemInt */
29280 0 : static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
29281 0 : PyObject *r;
29282 0 : if (unlikely(!j)) return NULL;
29283 0 : r = PyObject_GetItem(o, j);
29284 0 : Py_DECREF(j);
29285 : return r;
29286 : }
29287 3 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
29288 : CYTHON_NCP_UNUSED int wraparound,
29289 : CYTHON_NCP_UNUSED int boundscheck) {
29290 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29291 3 : Py_ssize_t wrapped_i = i;
29292 3 : if (wraparound & unlikely(i < 0)) {
29293 0 : wrapped_i += PyList_GET_SIZE(o);
29294 : }
29295 3 : if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
29296 3 : PyObject *r = PyList_GET_ITEM(o, wrapped_i);
29297 3 : Py_INCREF(r);
29298 3 : return r;
29299 : }
29300 0 : return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29301 : #else
29302 : return PySequence_GetItem(o, i);
29303 : #endif
29304 : }
29305 3 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
29306 : CYTHON_NCP_UNUSED int wraparound,
29307 : CYTHON_NCP_UNUSED int boundscheck) {
29308 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29309 3 : Py_ssize_t wrapped_i = i;
29310 3 : if (wraparound & unlikely(i < 0)) {
29311 0 : wrapped_i += PyTuple_GET_SIZE(o);
29312 : }
29313 3 : if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
29314 3 : PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
29315 3 : Py_INCREF(r);
29316 3 : return r;
29317 : }
29318 0 : return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29319 : #else
29320 : return PySequence_GetItem(o, i);
29321 : #endif
29322 : }
29323 11 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
29324 : CYTHON_NCP_UNUSED int wraparound,
29325 : CYTHON_NCP_UNUSED int boundscheck) {
29326 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
29327 11 : if (is_list || PyList_CheckExact(o)) {
29328 0 : Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
29329 0 : if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
29330 0 : PyObject *r = PyList_GET_ITEM(o, n);
29331 0 : Py_INCREF(r);
29332 0 : return r;
29333 : }
29334 : }
29335 11 : else if (PyTuple_CheckExact(o)) {
29336 11 : Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
29337 11 : if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
29338 11 : PyObject *r = PyTuple_GET_ITEM(o, n);
29339 11 : Py_INCREF(r);
29340 11 : return r;
29341 : }
29342 : } else {
29343 0 : PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
29344 0 : PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
29345 0 : if (mm && mm->mp_subscript) {
29346 0 : PyObject *r, *key = PyInt_FromSsize_t(i);
29347 0 : if (unlikely(!key)) return NULL;
29348 0 : r = mm->mp_subscript(o, key);
29349 0 : Py_DECREF(key);
29350 0 : return r;
29351 : }
29352 0 : if (likely(sm && sm->sq_item)) {
29353 0 : if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
29354 0 : Py_ssize_t l = sm->sq_length(o);
29355 0 : if (likely(l >= 0)) {
29356 0 : i += l;
29357 : } else {
29358 0 : if (!PyErr_ExceptionMatches(PyExc_OverflowError))
29359 : return NULL;
29360 0 : PyErr_Clear();
29361 : }
29362 : }
29363 0 : return sm->sq_item(o, i);
29364 : }
29365 : }
29366 : #else
29367 : if (is_list || !PyMapping_Check(o)) {
29368 : return PySequence_GetItem(o, i);
29369 : }
29370 : #endif
29371 0 : return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29372 : }
29373 :
29374 : /* PyObjectCallOneArg */
29375 6 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
29376 6 : PyObject *args[2] = {NULL, arg};
29377 6 : return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
29378 : }
29379 :
29380 : /* ObjectGetItem */
29381 : #if CYTHON_USE_TYPE_SLOTS
29382 0 : static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
29383 0 : PyObject *runerr = NULL;
29384 0 : Py_ssize_t key_value;
29385 0 : key_value = __Pyx_PyIndex_AsSsize_t(index);
29386 0 : if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
29387 0 : return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
29388 : }
29389 0 : if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
29390 0 : __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index));
29391 0 : PyErr_Clear();
29392 0 : PyErr_Format(PyExc_IndexError,
29393 : "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
29394 : __Pyx_DECREF_TypeName(index_type_name);
29395 : }
29396 : return NULL;
29397 : }
29398 0 : static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
29399 0 : __Pyx_TypeName obj_type_name;
29400 0 : if (likely(PyType_Check(obj))) {
29401 0 : PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem);
29402 0 : if (!meth) {
29403 0 : PyErr_Clear();
29404 : } else {
29405 0 : PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
29406 0 : Py_DECREF(meth);
29407 0 : return result;
29408 : }
29409 : }
29410 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
29411 0 : PyErr_Format(PyExc_TypeError,
29412 : "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
29413 0 : __Pyx_DECREF_TypeName(obj_type_name);
29414 0 : return NULL;
29415 : }
29416 3 : static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
29417 3 : PyTypeObject *tp = Py_TYPE(obj);
29418 3 : PyMappingMethods *mm = tp->tp_as_mapping;
29419 3 : PySequenceMethods *sm = tp->tp_as_sequence;
29420 3 : if (likely(mm && mm->mp_subscript)) {
29421 3 : return mm->mp_subscript(obj, key);
29422 : }
29423 0 : if (likely(sm && sm->sq_item)) {
29424 0 : return __Pyx_PyObject_GetIndex(obj, key);
29425 : }
29426 0 : return __Pyx_PyObject_GetItem_Slow(obj, key);
29427 : }
29428 : #endif
29429 :
29430 : /* KeywordStringCheck */
29431 0 : static int __Pyx_CheckKeywordStrings(
29432 : PyObject *kw,
29433 : const char* function_name,
29434 : int kw_allowed)
29435 : {
29436 0 : PyObject* key = 0;
29437 0 : Py_ssize_t pos = 0;
29438 : #if CYTHON_COMPILING_IN_PYPY
29439 : if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0))
29440 : goto invalid_keyword;
29441 : return 1;
29442 : #else
29443 0 : if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) {
29444 0 : Py_ssize_t kwsize;
29445 : #if CYTHON_ASSUME_SAFE_MACROS
29446 0 : kwsize = PyTuple_GET_SIZE(kw);
29447 : #else
29448 : kwsize = PyTuple_Size(kw);
29449 : if (kwsize < 0) return 0;
29450 : #endif
29451 0 : if (unlikely(kwsize == 0))
29452 : return 1;
29453 0 : if (!kw_allowed) {
29454 : #if CYTHON_ASSUME_SAFE_MACROS
29455 0 : key = PyTuple_GET_ITEM(kw, 0);
29456 : #else
29457 : key = PyTuple_GetItem(kw, pos);
29458 : if (!key) return 0;
29459 : #endif
29460 0 : goto invalid_keyword;
29461 : }
29462 : #if PY_VERSION_HEX < 0x03090000
29463 : for (pos = 0; pos < kwsize; pos++) {
29464 : #if CYTHON_ASSUME_SAFE_MACROS
29465 : key = PyTuple_GET_ITEM(kw, pos);
29466 : #else
29467 : key = PyTuple_GetItem(kw, pos);
29468 : if (!key) return 0;
29469 : #endif
29470 : if (unlikely(!PyUnicode_Check(key)))
29471 : goto invalid_keyword_type;
29472 : }
29473 : #endif
29474 : return 1;
29475 : }
29476 0 : while (PyDict_Next(kw, &pos, &key, 0)) {
29477 : #if PY_MAJOR_VERSION < 3
29478 : if (unlikely(!PyString_Check(key)))
29479 : #endif
29480 0 : if (unlikely(!PyUnicode_Check(key)))
29481 0 : goto invalid_keyword_type;
29482 : }
29483 0 : if (!kw_allowed && unlikely(key))
29484 0 : goto invalid_keyword;
29485 : return 1;
29486 0 : invalid_keyword_type:
29487 0 : PyErr_Format(PyExc_TypeError,
29488 : "%.200s() keywords must be strings", function_name);
29489 0 : return 0;
29490 : #endif
29491 0 : invalid_keyword:
29492 : #if PY_MAJOR_VERSION < 3
29493 : PyErr_Format(PyExc_TypeError,
29494 : "%.200s() got an unexpected keyword argument '%.200s'",
29495 : function_name, PyString_AsString(key));
29496 : #else
29497 0 : PyErr_Format(PyExc_TypeError,
29498 : "%s() got an unexpected keyword argument '%U'",
29499 : function_name, key);
29500 : #endif
29501 0 : return 0;
29502 : }
29503 :
29504 : /* DivInt[Py_ssize_t] */
29505 0 : static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
29506 0 : Py_ssize_t q = a / b;
29507 0 : Py_ssize_t r = a - q*b;
29508 0 : q -= ((r != 0) & ((r ^ b) < 0));
29509 0 : return q;
29510 : }
29511 :
29512 : /* GetAttr3 */
29513 : #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
29514 0 : static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
29515 0 : __Pyx_PyThreadState_declare
29516 0 : __Pyx_PyThreadState_assign
29517 0 : if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
29518 : return NULL;
29519 0 : __Pyx_PyErr_Clear();
29520 0 : Py_INCREF(d);
29521 : return d;
29522 : }
29523 : #endif
29524 0 : static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
29525 0 : PyObject *r;
29526 : #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
29527 : int res = PyObject_GetOptionalAttr(o, n, &r);
29528 : return (res != 0) ? r : __Pyx_NewRef(d);
29529 : #else
29530 : #if CYTHON_USE_TYPE_SLOTS
29531 0 : if (likely(PyString_Check(n))) {
29532 0 : r = __Pyx_PyObject_GetAttrStrNoError(o, n);
29533 0 : if (unlikely(!r) && likely(!PyErr_Occurred())) {
29534 0 : r = __Pyx_NewRef(d);
29535 : }
29536 0 : return r;
29537 : }
29538 : #endif
29539 0 : r = PyObject_GetAttr(o, n);
29540 0 : return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
29541 : #endif
29542 : }
29543 :
29544 : /* PyDictVersioning */
29545 : #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
29546 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
29547 : PyObject *dict = Py_TYPE(obj)->tp_dict;
29548 : return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
29549 : }
29550 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
29551 : PyObject **dictptr = NULL;
29552 : Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
29553 : if (offset) {
29554 : #if CYTHON_COMPILING_IN_CPYTHON
29555 : dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
29556 : #else
29557 : dictptr = _PyObject_GetDictPtr(obj);
29558 : #endif
29559 : }
29560 : return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
29561 : }
29562 : static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
29563 : PyObject *dict = Py_TYPE(obj)->tp_dict;
29564 : if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
29565 : return 0;
29566 : return obj_dict_version == __Pyx_get_object_dict_version(obj);
29567 : }
29568 : #endif
29569 :
29570 : /* GetModuleGlobalName */
29571 : #if CYTHON_USE_DICT_VERSIONS
29572 : static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
29573 : #else
29574 55 : static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
29575 : #endif
29576 : {
29577 55 : PyObject *result;
29578 : #if !CYTHON_AVOID_BORROWED_REFS
29579 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000
29580 55 : result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
29581 : __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
29582 55 : if (likely(result)) {
29583 110 : return __Pyx_NewRef(result);
29584 0 : } else if (unlikely(PyErr_Occurred())) {
29585 : return NULL;
29586 : }
29587 : #elif CYTHON_COMPILING_IN_LIMITED_API
29588 : if (unlikely(!__pyx_m)) {
29589 : return NULL;
29590 : }
29591 : result = PyObject_GetAttr(__pyx_m, name);
29592 : if (likely(result)) {
29593 : return result;
29594 : }
29595 : #else
29596 : result = PyDict_GetItem(__pyx_d, name);
29597 : __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
29598 : if (likely(result)) {
29599 : return __Pyx_NewRef(result);
29600 : }
29601 : #endif
29602 : #else
29603 : result = PyObject_GetItem(__pyx_d, name);
29604 : __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
29605 : if (likely(result)) {
29606 : return __Pyx_NewRef(result);
29607 : }
29608 : PyErr_Clear();
29609 : #endif
29610 0 : return __Pyx_GetBuiltinName(name);
29611 : }
29612 :
29613 : /* RaiseTooManyValuesToUnpack */
29614 0 : static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
29615 0 : PyErr_Format(PyExc_ValueError,
29616 : "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
29617 0 : }
29618 :
29619 : /* RaiseNeedMoreValuesToUnpack */
29620 0 : static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
29621 0 : PyErr_Format(PyExc_ValueError,
29622 : "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
29623 : index, (index == 1) ? "" : "s");
29624 0 : }
29625 :
29626 : /* RaiseNoneIterError */
29627 0 : static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
29628 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
29629 0 : }
29630 :
29631 : /* ExtTypeTest */
29632 18 : static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
29633 18 : __Pyx_TypeName obj_type_name;
29634 18 : __Pyx_TypeName type_name;
29635 18 : if (unlikely(!type)) {
29636 0 : PyErr_SetString(PyExc_SystemError, "Missing type object");
29637 0 : return 0;
29638 : }
29639 18 : if (likely(__Pyx_TypeCheck(obj, type)))
29640 : return 1;
29641 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
29642 0 : type_name = __Pyx_PyType_GetName(type);
29643 0 : PyErr_Format(PyExc_TypeError,
29644 : "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
29645 : obj_type_name, type_name);
29646 0 : __Pyx_DECREF_TypeName(obj_type_name);
29647 0 : __Pyx_DECREF_TypeName(type_name);
29648 0 : return 0;
29649 : }
29650 :
29651 : /* GetTopmostException */
29652 : #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
29653 : static _PyErr_StackItem *
29654 15 : __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
29655 : {
29656 15 : _PyErr_StackItem *exc_info = tstate->exc_info;
29657 70 : while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
29658 70 : exc_info->previous_item != NULL)
29659 : {
29660 : exc_info = exc_info->previous_item;
29661 : }
29662 15 : return exc_info;
29663 : }
29664 : #endif
29665 :
29666 : /* SaveResetException */
29667 : #if CYTHON_FAST_THREAD_STATE
29668 15 : static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
29669 : #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
29670 15 : _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
29671 15 : PyObject *exc_value = exc_info->exc_value;
29672 15 : if (exc_value == NULL || exc_value == Py_None) {
29673 15 : *value = NULL;
29674 15 : *type = NULL;
29675 15 : *tb = NULL;
29676 : } else {
29677 0 : *value = exc_value;
29678 0 : Py_INCREF(*value);
29679 0 : *type = (PyObject*) Py_TYPE(exc_value);
29680 0 : Py_INCREF(*type);
29681 0 : *tb = PyException_GetTraceback(exc_value);
29682 : }
29683 : #elif CYTHON_USE_EXC_INFO_STACK
29684 : _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
29685 : *type = exc_info->exc_type;
29686 : *value = exc_info->exc_value;
29687 : *tb = exc_info->exc_traceback;
29688 : Py_XINCREF(*type);
29689 : Py_XINCREF(*value);
29690 : Py_XINCREF(*tb);
29691 : #else
29692 : *type = tstate->exc_type;
29693 : *value = tstate->exc_value;
29694 : *tb = tstate->exc_traceback;
29695 : Py_XINCREF(*type);
29696 : Py_XINCREF(*value);
29697 : Py_XINCREF(*tb);
29698 : #endif
29699 15 : }
29700 0 : static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
29701 : #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
29702 0 : _PyErr_StackItem *exc_info = tstate->exc_info;
29703 0 : PyObject *tmp_value = exc_info->exc_value;
29704 0 : exc_info->exc_value = value;
29705 0 : Py_XDECREF(tmp_value);
29706 0 : Py_XDECREF(type);
29707 0 : Py_XDECREF(tb);
29708 : #else
29709 : PyObject *tmp_type, *tmp_value, *tmp_tb;
29710 : #if CYTHON_USE_EXC_INFO_STACK
29711 : _PyErr_StackItem *exc_info = tstate->exc_info;
29712 : tmp_type = exc_info->exc_type;
29713 : tmp_value = exc_info->exc_value;
29714 : tmp_tb = exc_info->exc_traceback;
29715 : exc_info->exc_type = type;
29716 : exc_info->exc_value = value;
29717 : exc_info->exc_traceback = tb;
29718 : #else
29719 : tmp_type = tstate->exc_type;
29720 : tmp_value = tstate->exc_value;
29721 : tmp_tb = tstate->exc_traceback;
29722 : tstate->exc_type = type;
29723 : tstate->exc_value = value;
29724 : tstate->exc_traceback = tb;
29725 : #endif
29726 : Py_XDECREF(tmp_type);
29727 : Py_XDECREF(tmp_value);
29728 : Py_XDECREF(tmp_tb);
29729 : #endif
29730 0 : }
29731 : #endif
29732 :
29733 : /* GetException */
29734 : #if CYTHON_FAST_THREAD_STATE
29735 0 : static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
29736 : #else
29737 : static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
29738 : #endif
29739 : {
29740 0 : PyObject *local_type = NULL, *local_value, *local_tb = NULL;
29741 : #if CYTHON_FAST_THREAD_STATE
29742 0 : PyObject *tmp_type, *tmp_value, *tmp_tb;
29743 : #if PY_VERSION_HEX >= 0x030C00A6
29744 0 : local_value = tstate->current_exception;
29745 0 : tstate->current_exception = 0;
29746 0 : if (likely(local_value)) {
29747 0 : local_type = (PyObject*) Py_TYPE(local_value);
29748 0 : Py_INCREF(local_type);
29749 0 : local_tb = PyException_GetTraceback(local_value);
29750 : }
29751 : #else
29752 : local_type = tstate->curexc_type;
29753 : local_value = tstate->curexc_value;
29754 : local_tb = tstate->curexc_traceback;
29755 : tstate->curexc_type = 0;
29756 : tstate->curexc_value = 0;
29757 : tstate->curexc_traceback = 0;
29758 : #endif
29759 : #else
29760 : PyErr_Fetch(&local_type, &local_value, &local_tb);
29761 : #endif
29762 0 : PyErr_NormalizeException(&local_type, &local_value, &local_tb);
29763 : #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6
29764 0 : if (unlikely(tstate->current_exception))
29765 : #elif CYTHON_FAST_THREAD_STATE
29766 : if (unlikely(tstate->curexc_type))
29767 : #else
29768 : if (unlikely(PyErr_Occurred()))
29769 : #endif
29770 0 : goto bad;
29771 : #if PY_MAJOR_VERSION >= 3
29772 0 : if (local_tb) {
29773 0 : if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
29774 0 : goto bad;
29775 : }
29776 : #endif
29777 0 : Py_XINCREF(local_tb);
29778 0 : Py_XINCREF(local_type);
29779 0 : Py_XINCREF(local_value);
29780 0 : *type = local_type;
29781 0 : *value = local_value;
29782 0 : *tb = local_tb;
29783 : #if CYTHON_FAST_THREAD_STATE
29784 : #if CYTHON_USE_EXC_INFO_STACK
29785 : {
29786 0 : _PyErr_StackItem *exc_info = tstate->exc_info;
29787 : #if PY_VERSION_HEX >= 0x030B00a4
29788 0 : tmp_value = exc_info->exc_value;
29789 0 : exc_info->exc_value = local_value;
29790 0 : tmp_type = NULL;
29791 0 : tmp_tb = NULL;
29792 0 : Py_XDECREF(local_type);
29793 0 : Py_XDECREF(local_tb);
29794 : #else
29795 : tmp_type = exc_info->exc_type;
29796 : tmp_value = exc_info->exc_value;
29797 : tmp_tb = exc_info->exc_traceback;
29798 : exc_info->exc_type = local_type;
29799 : exc_info->exc_value = local_value;
29800 : exc_info->exc_traceback = local_tb;
29801 : #endif
29802 : }
29803 : #else
29804 : tmp_type = tstate->exc_type;
29805 : tmp_value = tstate->exc_value;
29806 : tmp_tb = tstate->exc_traceback;
29807 : tstate->exc_type = local_type;
29808 : tstate->exc_value = local_value;
29809 : tstate->exc_traceback = local_tb;
29810 : #endif
29811 0 : Py_XDECREF(tmp_type);
29812 0 : Py_XDECREF(tmp_value);
29813 0 : Py_XDECREF(tmp_tb);
29814 : #else
29815 : PyErr_SetExcInfo(local_type, local_value, local_tb);
29816 : #endif
29817 0 : return 0;
29818 0 : bad:
29819 0 : *type = 0;
29820 0 : *value = 0;
29821 0 : *tb = 0;
29822 0 : Py_XDECREF(local_type);
29823 0 : Py_XDECREF(local_value);
29824 0 : Py_XDECREF(local_tb);
29825 0 : return -1;
29826 : }
29827 :
29828 : /* SwapException */
29829 : #if CYTHON_FAST_THREAD_STATE
29830 0 : static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
29831 0 : PyObject *tmp_type, *tmp_value, *tmp_tb;
29832 : #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
29833 0 : _PyErr_StackItem *exc_info = tstate->exc_info;
29834 0 : tmp_value = exc_info->exc_value;
29835 0 : exc_info->exc_value = *value;
29836 0 : if (tmp_value == NULL || tmp_value == Py_None) {
29837 0 : Py_XDECREF(tmp_value);
29838 0 : tmp_value = NULL;
29839 0 : tmp_type = NULL;
29840 0 : tmp_tb = NULL;
29841 : } else {
29842 0 : tmp_type = (PyObject*) Py_TYPE(tmp_value);
29843 0 : Py_INCREF(tmp_type);
29844 : #if CYTHON_COMPILING_IN_CPYTHON
29845 0 : tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
29846 0 : Py_XINCREF(tmp_tb);
29847 : #else
29848 : tmp_tb = PyException_GetTraceback(tmp_value);
29849 : #endif
29850 : }
29851 : #elif CYTHON_USE_EXC_INFO_STACK
29852 : _PyErr_StackItem *exc_info = tstate->exc_info;
29853 : tmp_type = exc_info->exc_type;
29854 : tmp_value = exc_info->exc_value;
29855 : tmp_tb = exc_info->exc_traceback;
29856 : exc_info->exc_type = *type;
29857 : exc_info->exc_value = *value;
29858 : exc_info->exc_traceback = *tb;
29859 : #else
29860 : tmp_type = tstate->exc_type;
29861 : tmp_value = tstate->exc_value;
29862 : tmp_tb = tstate->exc_traceback;
29863 : tstate->exc_type = *type;
29864 : tstate->exc_value = *value;
29865 : tstate->exc_traceback = *tb;
29866 : #endif
29867 0 : *type = tmp_type;
29868 0 : *value = tmp_value;
29869 0 : *tb = tmp_tb;
29870 0 : }
29871 : #else
29872 : static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
29873 : PyObject *tmp_type, *tmp_value, *tmp_tb;
29874 : PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
29875 : PyErr_SetExcInfo(*type, *value, *tb);
29876 : *type = tmp_type;
29877 : *value = tmp_value;
29878 : *tb = tmp_tb;
29879 : }
29880 : #endif
29881 :
29882 : /* Import */
29883 13 : static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
29884 13 : PyObject *module = 0;
29885 13 : PyObject *empty_dict = 0;
29886 13 : PyObject *empty_list = 0;
29887 : #if PY_MAJOR_VERSION < 3
29888 : PyObject *py_import;
29889 : py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
29890 : if (unlikely(!py_import))
29891 : goto bad;
29892 : if (!from_list) {
29893 : empty_list = PyList_New(0);
29894 : if (unlikely(!empty_list))
29895 : goto bad;
29896 : from_list = empty_list;
29897 : }
29898 : #endif
29899 13 : empty_dict = PyDict_New();
29900 13 : if (unlikely(!empty_dict))
29901 0 : goto bad;
29902 : {
29903 : #if PY_MAJOR_VERSION >= 3
29904 13 : if (level == -1) {
29905 0 : if (strchr(__Pyx_MODULE_NAME, '.') != NULL) {
29906 0 : module = PyImport_ImportModuleLevelObject(
29907 0 : name, __pyx_d, empty_dict, from_list, 1);
29908 0 : if (unlikely(!module)) {
29909 0 : if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
29910 0 : goto bad;
29911 0 : PyErr_Clear();
29912 : }
29913 : }
29914 0 : level = 0;
29915 : }
29916 : #endif
29917 0 : if (!module) {
29918 : #if PY_MAJOR_VERSION < 3
29919 : PyObject *py_level = PyInt_FromLong(level);
29920 : if (unlikely(!py_level))
29921 : goto bad;
29922 : module = PyObject_CallFunctionObjArgs(py_import,
29923 : name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL);
29924 : Py_DECREF(py_level);
29925 : #else
29926 13 : module = PyImport_ImportModuleLevelObject(
29927 13 : name, __pyx_d, empty_dict, from_list, level);
29928 : #endif
29929 : }
29930 : }
29931 13 : bad:
29932 13 : Py_XDECREF(empty_dict);
29933 13 : Py_XDECREF(empty_list);
29934 : #if PY_MAJOR_VERSION < 3
29935 : Py_XDECREF(py_import);
29936 : #endif
29937 13 : return module;
29938 : }
29939 :
29940 : /* ImportDottedModule */
29941 : #if PY_MAJOR_VERSION >= 3
29942 0 : static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
29943 0 : PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
29944 0 : if (unlikely(PyErr_Occurred())) {
29945 0 : PyErr_Clear();
29946 : }
29947 0 : if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) {
29948 : partial_name = name;
29949 : } else {
29950 0 : slice = PySequence_GetSlice(parts_tuple, 0, count);
29951 0 : if (unlikely(!slice))
29952 0 : goto bad;
29953 0 : sep = PyUnicode_FromStringAndSize(".", 1);
29954 0 : if (unlikely(!sep))
29955 0 : goto bad;
29956 0 : partial_name = PyUnicode_Join(sep, slice);
29957 : }
29958 0 : PyErr_Format(
29959 : #if PY_MAJOR_VERSION < 3
29960 : PyExc_ImportError,
29961 : "No module named '%s'", PyString_AS_STRING(partial_name));
29962 : #else
29963 : #if PY_VERSION_HEX >= 0x030600B1
29964 : PyExc_ModuleNotFoundError,
29965 : #else
29966 : PyExc_ImportError,
29967 : #endif
29968 : "No module named '%U'", partial_name);
29969 : #endif
29970 0 : bad:
29971 0 : Py_XDECREF(sep);
29972 0 : Py_XDECREF(slice);
29973 0 : Py_XDECREF(partial_name);
29974 0 : return NULL;
29975 : }
29976 : #endif
29977 : #if PY_MAJOR_VERSION >= 3
29978 3 : static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
29979 3 : PyObject *imported_module;
29980 : #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
29981 : PyObject *modules = PyImport_GetModuleDict();
29982 : if (unlikely(!modules))
29983 : return NULL;
29984 : imported_module = __Pyx_PyDict_GetItemStr(modules, name);
29985 : Py_XINCREF(imported_module);
29986 : #else
29987 6 : imported_module = PyImport_GetModule(name);
29988 : #endif
29989 3 : return imported_module;
29990 : }
29991 : #endif
29992 : #if PY_MAJOR_VERSION >= 3
29993 0 : static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) {
29994 0 : Py_ssize_t i, nparts;
29995 0 : nparts = PyTuple_GET_SIZE(parts_tuple);
29996 0 : for (i=1; i < nparts && module; i++) {
29997 0 : PyObject *part, *submodule;
29998 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29999 0 : part = PyTuple_GET_ITEM(parts_tuple, i);
30000 : #else
30001 : part = PySequence_ITEM(parts_tuple, i);
30002 : #endif
30003 0 : submodule = __Pyx_PyObject_GetAttrStrNoError(module, part);
30004 : #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
30005 : Py_DECREF(part);
30006 : #endif
30007 0 : Py_DECREF(module);
30008 0 : module = submodule;
30009 : }
30010 0 : if (unlikely(!module)) {
30011 0 : return __Pyx__ImportDottedModule_Error(name, parts_tuple, i);
30012 : }
30013 : return module;
30014 : }
30015 : #endif
30016 0 : static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
30017 : #if PY_MAJOR_VERSION < 3
30018 : PyObject *module, *from_list, *star = __pyx_n_s__3;
30019 : CYTHON_UNUSED_VAR(parts_tuple);
30020 : from_list = PyList_New(1);
30021 : if (unlikely(!from_list))
30022 : return NULL;
30023 : Py_INCREF(star);
30024 : PyList_SET_ITEM(from_list, 0, star);
30025 : module = __Pyx_Import(name, from_list, 0);
30026 : Py_DECREF(from_list);
30027 : return module;
30028 : #else
30029 0 : PyObject *imported_module;
30030 0 : PyObject *module = __Pyx_Import(name, NULL, 0);
30031 0 : if (!parts_tuple || unlikely(!module))
30032 : return module;
30033 0 : imported_module = __Pyx__ImportDottedModule_Lookup(name);
30034 0 : if (likely(imported_module)) {
30035 0 : Py_DECREF(module);
30036 0 : return imported_module;
30037 : }
30038 0 : PyErr_Clear();
30039 0 : return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple);
30040 : #endif
30041 : }
30042 3 : static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
30043 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1
30044 3 : PyObject *module = __Pyx__ImportDottedModule_Lookup(name);
30045 3 : if (likely(module)) {
30046 3 : PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec);
30047 3 : if (likely(spec)) {
30048 3 : PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing);
30049 3 : if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) {
30050 3 : Py_DECREF(spec);
30051 : spec = NULL;
30052 : }
30053 3 : Py_XDECREF(unsafe);
30054 : }
30055 3 : if (likely(!spec)) {
30056 3 : PyErr_Clear();
30057 3 : return module;
30058 : }
30059 0 : Py_DECREF(spec);
30060 0 : Py_DECREF(module);
30061 0 : } else if (PyErr_Occurred()) {
30062 0 : PyErr_Clear();
30063 : }
30064 : #endif
30065 0 : return __Pyx__ImportDottedModule(name, parts_tuple);
30066 : }
30067 :
30068 : /* FastTypeChecks */
30069 : #if CYTHON_COMPILING_IN_CPYTHON
30070 : static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
30071 0 : while (a) {
30072 0 : a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
30073 0 : if (a == b)
30074 : return 1;
30075 : }
30076 0 : return b == &PyBaseObject_Type;
30077 : }
30078 21 : static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
30079 21 : PyObject *mro;
30080 21 : if (a == b) return 1;
30081 0 : mro = a->tp_mro;
30082 0 : if (likely(mro)) {
30083 0 : Py_ssize_t i, n;
30084 0 : n = PyTuple_GET_SIZE(mro);
30085 0 : for (i = 0; i < n; i++) {
30086 0 : if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
30087 : return 1;
30088 : }
30089 : return 0;
30090 : }
30091 21 : return __Pyx_InBases(a, b);
30092 : }
30093 47 : static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
30094 47 : PyObject *mro;
30095 47 : if (cls == a || cls == b) return 1;
30096 39 : mro = cls->tp_mro;
30097 39 : if (likely(mro)) {
30098 39 : Py_ssize_t i, n;
30099 39 : n = PyTuple_GET_SIZE(mro);
30100 117 : for (i = 0; i < n; i++) {
30101 78 : PyObject *base = PyTuple_GET_ITEM(mro, i);
30102 78 : if (base == (PyObject *)a || base == (PyObject *)b)
30103 : return 1;
30104 : }
30105 : return 0;
30106 : }
30107 0 : return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
30108 : }
30109 : #if PY_MAJOR_VERSION == 2
30110 : static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
30111 : PyObject *exception, *value, *tb;
30112 : int res;
30113 : __Pyx_PyThreadState_declare
30114 : __Pyx_PyThreadState_assign
30115 : __Pyx_ErrFetch(&exception, &value, &tb);
30116 : res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
30117 : if (unlikely(res == -1)) {
30118 : PyErr_WriteUnraisable(err);
30119 : res = 0;
30120 : }
30121 : if (!res) {
30122 : res = PyObject_IsSubclass(err, exc_type2);
30123 : if (unlikely(res == -1)) {
30124 : PyErr_WriteUnraisable(err);
30125 : res = 0;
30126 : }
30127 : }
30128 : __Pyx_ErrRestore(exception, value, tb);
30129 : return res;
30130 : }
30131 : #else
30132 0 : static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
30133 0 : if (exc_type1) {
30134 0 : return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
30135 : } else {
30136 0 : return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
30137 : }
30138 : }
30139 : #endif
30140 0 : static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
30141 0 : Py_ssize_t i, n;
30142 0 : assert(PyExceptionClass_Check(exc_type));
30143 0 : n = PyTuple_GET_SIZE(tuple);
30144 : #if PY_MAJOR_VERSION >= 3
30145 0 : for (i=0; i<n; i++) {
30146 0 : if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
30147 : }
30148 : #endif
30149 0 : for (i=0; i<n; i++) {
30150 0 : PyObject *t = PyTuple_GET_ITEM(tuple, i);
30151 : #if PY_MAJOR_VERSION < 3
30152 : if (likely(exc_type == t)) return 1;
30153 : #endif
30154 0 : if (likely(PyExceptionClass_Check(t))) {
30155 0 : if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
30156 : } else {
30157 0 : }
30158 : }
30159 : return 0;
30160 : }
30161 0 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
30162 0 : if (likely(err == exc_type)) return 1;
30163 0 : if (likely(PyExceptionClass_Check(err))) {
30164 0 : if (likely(PyExceptionClass_Check(exc_type))) {
30165 0 : return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
30166 0 : } else if (likely(PyTuple_Check(exc_type))) {
30167 0 : return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
30168 : } else {
30169 0 : }
30170 : }
30171 0 : return PyErr_GivenExceptionMatches(err, exc_type);
30172 : }
30173 0 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
30174 0 : assert(PyExceptionClass_Check(exc_type1));
30175 0 : assert(PyExceptionClass_Check(exc_type2));
30176 0 : if (likely(err == exc_type1 || err == exc_type2)) return 1;
30177 0 : if (likely(PyExceptionClass_Check(err))) {
30178 0 : return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
30179 : }
30180 0 : return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
30181 : }
30182 : #endif
30183 :
30184 : /* PySequenceMultiply */
30185 0 : static PyObject* __Pyx_PySequence_Multiply_Generic(PyObject *seq, Py_ssize_t mul) {
30186 0 : PyObject *result, *pymul = PyInt_FromSsize_t(mul);
30187 0 : if (unlikely(!pymul))
30188 : return NULL;
30189 0 : result = PyNumber_Multiply(seq, pymul);
30190 0 : Py_DECREF(pymul);
30191 : return result;
30192 : }
30193 0 : static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul) {
30194 : #if CYTHON_USE_TYPE_SLOTS
30195 0 : PyTypeObject *type = Py_TYPE(seq);
30196 0 : if (likely(type->tp_as_sequence && type->tp_as_sequence->sq_repeat)) {
30197 0 : return type->tp_as_sequence->sq_repeat(seq, mul);
30198 : } else
30199 : #endif
30200 : {
30201 0 : return __Pyx_PySequence_Multiply_Generic(seq, mul);
30202 : }
30203 : }
30204 :
30205 : /* SetItemInt */
30206 0 : static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
30207 0 : int r;
30208 0 : if (unlikely(!j)) return -1;
30209 0 : r = PyObject_SetItem(o, j, v);
30210 0 : Py_DECREF(j);
30211 : return r;
30212 : }
30213 3 : static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
30214 : CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
30215 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
30216 3 : if (is_list || PyList_CheckExact(o)) {
30217 3 : Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
30218 3 : if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
30219 3 : PyObject* old = PyList_GET_ITEM(o, n);
30220 3 : Py_INCREF(v);
30221 3 : PyList_SET_ITEM(o, n, v);
30222 3 : Py_DECREF(old);
30223 3 : return 1;
30224 : }
30225 : } else {
30226 0 : PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
30227 0 : PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
30228 0 : if (mm && mm->mp_ass_subscript) {
30229 0 : int r;
30230 0 : PyObject *key = PyInt_FromSsize_t(i);
30231 0 : if (unlikely(!key)) return -1;
30232 0 : r = mm->mp_ass_subscript(o, key, v);
30233 0 : Py_DECREF(key);
30234 0 : return r;
30235 : }
30236 0 : if (likely(sm && sm->sq_ass_item)) {
30237 0 : if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
30238 0 : Py_ssize_t l = sm->sq_length(o);
30239 0 : if (likely(l >= 0)) {
30240 0 : i += l;
30241 : } else {
30242 0 : if (!PyErr_ExceptionMatches(PyExc_OverflowError))
30243 : return -1;
30244 0 : PyErr_Clear();
30245 : }
30246 : }
30247 0 : return sm->sq_ass_item(o, i, v);
30248 : }
30249 : }
30250 : #else
30251 : if (is_list || !PyMapping_Check(o))
30252 : {
30253 : return PySequence_SetItem(o, i, v);
30254 : }
30255 : #endif
30256 0 : return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
30257 : }
30258 :
30259 : /* RaiseUnboundLocalError */
30260 0 : static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
30261 0 : PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
30262 : }
30263 :
30264 : /* DivInt[long] */
30265 0 : static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
30266 0 : long q = a / b;
30267 0 : long r = a - q*b;
30268 0 : q -= ((r != 0) & ((r ^ b) < 0));
30269 0 : return q;
30270 : }
30271 :
30272 : /* ImportFrom */
30273 18 : static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
30274 18 : PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
30275 18 : if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
30276 0 : const char* module_name_str = 0;
30277 0 : PyObject* module_name = 0;
30278 0 : PyObject* module_dot = 0;
30279 0 : PyObject* full_name = 0;
30280 0 : PyErr_Clear();
30281 0 : module_name_str = PyModule_GetName(module);
30282 0 : if (unlikely(!module_name_str)) { goto modbad; }
30283 0 : module_name = PyUnicode_FromString(module_name_str);
30284 0 : if (unlikely(!module_name)) { goto modbad; }
30285 0 : module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__2);
30286 0 : if (unlikely(!module_dot)) { goto modbad; }
30287 0 : full_name = PyUnicode_Concat(module_dot, name);
30288 0 : if (unlikely(!full_name)) { goto modbad; }
30289 : #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
30290 : {
30291 : PyObject *modules = PyImport_GetModuleDict();
30292 : if (unlikely(!modules))
30293 : goto modbad;
30294 : value = PyObject_GetItem(modules, full_name);
30295 : }
30296 : #else
30297 0 : value = PyImport_GetModule(full_name);
30298 : #endif
30299 0 : modbad:
30300 0 : Py_XDECREF(full_name);
30301 0 : Py_XDECREF(module_dot);
30302 0 : Py_XDECREF(module_name);
30303 : }
30304 18 : if (unlikely(!value)) {
30305 0 : PyErr_Format(PyExc_ImportError,
30306 : #if PY_MAJOR_VERSION < 3
30307 : "cannot import name %.230s", PyString_AS_STRING(name));
30308 : #else
30309 : "cannot import name %S", name);
30310 : #endif
30311 : }
30312 18 : return value;
30313 : }
30314 :
30315 : /* HasAttr */
30316 0 : static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
30317 0 : PyObject *r;
30318 0 : if (unlikely(!__Pyx_PyBaseString_Check(n))) {
30319 0 : PyErr_SetString(PyExc_TypeError,
30320 : "hasattr(): attribute name must be string");
30321 0 : return -1;
30322 : }
30323 0 : r = __Pyx_GetAttr(o, n);
30324 0 : if (!r) {
30325 0 : PyErr_Clear();
30326 0 : return 0;
30327 : } else {
30328 0 : Py_DECREF(r);
30329 0 : return 1;
30330 : }
30331 : }
30332 :
30333 : /* IsLittleEndian */
30334 0 : static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
30335 : {
30336 0 : union {
30337 : uint32_t u32;
30338 : uint8_t u8[4];
30339 : } S;
30340 0 : S.u32 = 0x01020304;
30341 0 : return S.u8[0] == 4;
30342 : }
30343 :
30344 : /* BufferFormatCheck */
30345 30 : static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
30346 : __Pyx_BufFmt_StackElem* stack,
30347 : __Pyx_TypeInfo* type) {
30348 30 : stack[0].field = &ctx->root;
30349 30 : stack[0].parent_offset = 0;
30350 30 : ctx->root.type = type;
30351 30 : ctx->root.name = "buffer dtype";
30352 30 : ctx->root.offset = 0;
30353 30 : ctx->head = stack;
30354 30 : ctx->head->field = &ctx->root;
30355 30 : ctx->fmt_offset = 0;
30356 30 : ctx->head->parent_offset = 0;
30357 30 : ctx->new_packmode = '@';
30358 30 : ctx->enc_packmode = '@';
30359 30 : ctx->new_count = 1;
30360 30 : ctx->enc_count = 0;
30361 30 : ctx->enc_type = 0;
30362 30 : ctx->is_complex = 0;
30363 30 : ctx->is_valid_array = 0;
30364 30 : ctx->struct_alignment = 0;
30365 30 : while (type->typegroup == 'S') {
30366 0 : ++ctx->head;
30367 0 : ctx->head->field = type->fields;
30368 0 : ctx->head->parent_offset = 0;
30369 0 : type = type->fields->type;
30370 : }
30371 30 : }
30372 0 : static int __Pyx_BufFmt_ParseNumber(const char** ts) {
30373 0 : int count;
30374 0 : const char* t = *ts;
30375 0 : if (*t < '0' || *t > '9') {
30376 : return -1;
30377 : } else {
30378 0 : count = *t++ - '0';
30379 0 : while (*t >= '0' && *t <= '9') {
30380 0 : count *= 10;
30381 0 : count += *t++ - '0';
30382 : }
30383 : }
30384 0 : *ts = t;
30385 0 : return count;
30386 : }
30387 0 : static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
30388 0 : int number = __Pyx_BufFmt_ParseNumber(ts);
30389 0 : if (number == -1)
30390 0 : PyErr_Format(PyExc_ValueError,\
30391 0 : "Does not understand character buffer dtype format string ('%c')", **ts);
30392 0 : return number;
30393 : }
30394 0 : static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
30395 0 : PyErr_Format(PyExc_ValueError,
30396 : "Unexpected format string character: '%c'", ch);
30397 : }
30398 0 : static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
30399 0 : switch (ch) {
30400 : case '?': return "'bool'";
30401 0 : case 'c': return "'char'";
30402 0 : case 'b': return "'signed char'";
30403 0 : case 'B': return "'unsigned char'";
30404 0 : case 'h': return "'short'";
30405 0 : case 'H': return "'unsigned short'";
30406 0 : case 'i': return "'int'";
30407 0 : case 'I': return "'unsigned int'";
30408 0 : case 'l': return "'long'";
30409 0 : case 'L': return "'unsigned long'";
30410 0 : case 'q': return "'long long'";
30411 0 : case 'Q': return "'unsigned long long'";
30412 0 : case 'f': return (is_complex ? "'complex float'" : "'float'");
30413 0 : case 'd': return (is_complex ? "'complex double'" : "'double'");
30414 0 : case 'g': return (is_complex ? "'complex long double'" : "'long double'");
30415 0 : case 'T': return "a struct";
30416 0 : case 'O': return "Python object";
30417 0 : case 'P': return "a pointer";
30418 0 : case 's': case 'p': return "a string";
30419 0 : case 0: return "end";
30420 0 : default: return "unparsable format string";
30421 : }
30422 : }
30423 0 : static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
30424 0 : switch (ch) {
30425 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
30426 0 : case 'h': case 'H': return 2;
30427 : case 'i': case 'I': case 'l': case 'L': return 4;
30428 : case 'q': case 'Q': return 8;
30429 0 : case 'f': return (is_complex ? 8 : 4);
30430 0 : case 'd': return (is_complex ? 16 : 8);
30431 0 : case 'g': {
30432 0 : PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
30433 0 : return 0;
30434 : }
30435 : case 'O': case 'P': return sizeof(void*);
30436 0 : default:
30437 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
30438 0 : return 0;
30439 : }
30440 : }
30441 30 : static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
30442 30 : switch (ch) {
30443 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
30444 0 : case 'h': case 'H': return sizeof(short);
30445 : case 'i': case 'I': return sizeof(int);
30446 : case 'l': case 'L': return sizeof(long);
30447 : #ifdef HAVE_LONG_LONG
30448 : case 'q': case 'Q': return sizeof(PY_LONG_LONG);
30449 : #endif
30450 0 : case 'f': return sizeof(float) * (is_complex ? 2 : 1);
30451 0 : case 'd': return sizeof(double) * (is_complex ? 2 : 1);
30452 0 : case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
30453 : case 'O': case 'P': return sizeof(void*);
30454 0 : default: {
30455 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
30456 0 : return 0;
30457 : }
30458 : }
30459 : }
30460 : typedef struct { char c; short x; } __Pyx_st_short;
30461 : typedef struct { char c; int x; } __Pyx_st_int;
30462 : typedef struct { char c; long x; } __Pyx_st_long;
30463 : typedef struct { char c; float x; } __Pyx_st_float;
30464 : typedef struct { char c; double x; } __Pyx_st_double;
30465 : typedef struct { char c; long double x; } __Pyx_st_longdouble;
30466 : typedef struct { char c; void *x; } __Pyx_st_void_p;
30467 : #ifdef HAVE_LONG_LONG
30468 : typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
30469 : #endif
30470 30 : static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) {
30471 30 : CYTHON_UNUSED_VAR(is_complex);
30472 30 : switch (ch) {
30473 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
30474 0 : case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
30475 : case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
30476 : case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
30477 : #ifdef HAVE_LONG_LONG
30478 : case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
30479 : #endif
30480 : case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
30481 : case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
30482 0 : case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
30483 : case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
30484 0 : default:
30485 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
30486 0 : return 0;
30487 : }
30488 : }
30489 : /* These are for computing the padding at the end of the struct to align
30490 : on the first member of the struct. This will probably the same as above,
30491 : but we don't have any guarantees.
30492 : */
30493 : typedef struct { short x; char c; } __Pyx_pad_short;
30494 : typedef struct { int x; char c; } __Pyx_pad_int;
30495 : typedef struct { long x; char c; } __Pyx_pad_long;
30496 : typedef struct { float x; char c; } __Pyx_pad_float;
30497 : typedef struct { double x; char c; } __Pyx_pad_double;
30498 : typedef struct { long double x; char c; } __Pyx_pad_longdouble;
30499 : typedef struct { void *x; char c; } __Pyx_pad_void_p;
30500 : #ifdef HAVE_LONG_LONG
30501 : typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
30502 : #endif
30503 30 : static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) {
30504 30 : CYTHON_UNUSED_VAR(is_complex);
30505 30 : switch (ch) {
30506 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
30507 0 : case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
30508 : case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
30509 : case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
30510 : #ifdef HAVE_LONG_LONG
30511 : case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
30512 : #endif
30513 : case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
30514 : case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
30515 0 : case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
30516 : case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
30517 0 : default:
30518 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
30519 0 : return 0;
30520 : }
30521 : }
30522 30 : static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
30523 30 : switch (ch) {
30524 : case 'c':
30525 : return 'H';
30526 30 : case 'b': case 'h': case 'i':
30527 : case 'l': case 'q': case 's': case 'p':
30528 30 : return 'I';
30529 0 : case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
30530 0 : return 'U';
30531 0 : case 'f': case 'd': case 'g':
30532 0 : return (is_complex ? 'C' : 'R');
30533 0 : case 'O':
30534 0 : return 'O';
30535 0 : case 'P':
30536 0 : return 'P';
30537 0 : default: {
30538 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
30539 0 : return 0;
30540 : }
30541 : }
30542 : }
30543 0 : static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
30544 0 : if (ctx->head == NULL || ctx->head->field == &ctx->root) {
30545 0 : const char* expected;
30546 0 : const char* quote;
30547 0 : if (ctx->head == NULL) {
30548 : expected = "end";
30549 : quote = "";
30550 : } else {
30551 0 : expected = ctx->head->field->type->name;
30552 0 : quote = "'";
30553 : }
30554 0 : PyErr_Format(PyExc_ValueError,
30555 : "Buffer dtype mismatch, expected %s%s%s but got %s",
30556 : quote, expected, quote,
30557 0 : __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
30558 : } else {
30559 0 : __Pyx_StructField* field = ctx->head->field;
30560 0 : __Pyx_StructField* parent = (ctx->head - 1)->field;
30561 0 : PyErr_Format(PyExc_ValueError,
30562 : "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
30563 0 : field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
30564 0 : parent->type->name, field->name);
30565 : }
30566 0 : }
30567 60 : static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
30568 60 : char group;
30569 60 : size_t size, offset, arraysize = 1;
30570 60 : if (ctx->enc_type == 0) return 0;
30571 30 : if (ctx->head->field->type->arraysize[0]) {
30572 0 : int i, ndim = 0;
30573 0 : if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
30574 0 : ctx->is_valid_array = ctx->head->field->type->ndim == 1;
30575 0 : ndim = 1;
30576 0 : if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
30577 0 : PyErr_Format(PyExc_ValueError,
30578 : "Expected a dimension of size %zu, got %zu",
30579 : ctx->head->field->type->arraysize[0], ctx->enc_count);
30580 0 : return -1;
30581 : }
30582 : }
30583 0 : if (!ctx->is_valid_array) {
30584 0 : PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
30585 : ctx->head->field->type->ndim, ndim);
30586 0 : return -1;
30587 : }
30588 0 : for (i = 0; i < ctx->head->field->type->ndim; i++) {
30589 0 : arraysize *= ctx->head->field->type->arraysize[i];
30590 : }
30591 0 : ctx->is_valid_array = 0;
30592 0 : ctx->enc_count = 1;
30593 : }
30594 30 : group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
30595 30 : do {
30596 30 : __Pyx_StructField* field = ctx->head->field;
30597 30 : __Pyx_TypeInfo* type = field->type;
30598 30 : if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
30599 30 : size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
30600 : } else {
30601 0 : size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
30602 : }
30603 30 : if (ctx->enc_packmode == '@') {
30604 30 : size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
30605 30 : size_t align_mod_offset;
30606 30 : if (align_at == 0) return -1;
30607 30 : align_mod_offset = ctx->fmt_offset % align_at;
30608 30 : if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
30609 30 : if (ctx->struct_alignment == 0)
30610 30 : ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
30611 : ctx->is_complex);
30612 : }
30613 30 : if (type->size != size || type->typegroup != group) {
30614 0 : if (type->typegroup == 'C' && type->fields != NULL) {
30615 0 : size_t parent_offset = ctx->head->parent_offset + field->offset;
30616 0 : ++ctx->head;
30617 0 : ctx->head->field = type->fields;
30618 0 : ctx->head->parent_offset = parent_offset;
30619 0 : continue;
30620 : }
30621 0 : if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
30622 : } else {
30623 0 : __Pyx_BufFmt_RaiseExpected(ctx);
30624 0 : return -1;
30625 : }
30626 : }
30627 30 : offset = ctx->head->parent_offset + field->offset;
30628 30 : if (ctx->fmt_offset != offset) {
30629 0 : PyErr_Format(PyExc_ValueError,
30630 : "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
30631 : (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
30632 0 : return -1;
30633 : }
30634 30 : ctx->fmt_offset += size;
30635 30 : if (arraysize)
30636 30 : ctx->fmt_offset += (arraysize - 1) * size;
30637 30 : --ctx->enc_count;
30638 30 : while (1) {
30639 30 : if (field == &ctx->root) {
30640 30 : ctx->head = NULL;
30641 30 : if (ctx->enc_count != 0) {
30642 0 : __Pyx_BufFmt_RaiseExpected(ctx);
30643 0 : return -1;
30644 : }
30645 : break;
30646 : }
30647 0 : ctx->head->field = ++field;
30648 0 : if (field->type == NULL) {
30649 0 : --ctx->head;
30650 0 : field = ctx->head->field;
30651 0 : continue;
30652 0 : } else if (field->type->typegroup == 'S') {
30653 0 : size_t parent_offset = ctx->head->parent_offset + field->offset;
30654 0 : if (field->type->fields->type == NULL) continue;
30655 0 : field = field->type->fields;
30656 0 : ++ctx->head;
30657 0 : ctx->head->field = field;
30658 0 : ctx->head->parent_offset = parent_offset;
30659 0 : break;
30660 : } else {
30661 : break;
30662 : }
30663 : }
30664 30 : } while (ctx->enc_count);
30665 30 : ctx->enc_type = 0;
30666 30 : ctx->is_complex = 0;
30667 30 : return 0;
30668 : }
30669 : static int
30670 0 : __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
30671 : {
30672 0 : const char *ts = *tsp;
30673 0 : int i = 0, number, ndim;
30674 0 : ++ts;
30675 0 : if (ctx->new_count != 1) {
30676 0 : PyErr_SetString(PyExc_ValueError,
30677 : "Cannot handle repeated arrays in format string");
30678 0 : return -1;
30679 : }
30680 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return -1;
30681 0 : ndim = ctx->head->field->type->ndim;
30682 0 : while (*ts && *ts != ')') {
30683 0 : switch (*ts) {
30684 0 : case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
30685 0 : default: break;
30686 : }
30687 0 : number = __Pyx_BufFmt_ExpectNumber(&ts);
30688 0 : if (number == -1) return -1;
30689 0 : if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) {
30690 0 : PyErr_Format(PyExc_ValueError,
30691 : "Expected a dimension of size %zu, got %d",
30692 : ctx->head->field->type->arraysize[i], number);
30693 0 : return -1;
30694 : }
30695 0 : if (*ts != ',' && *ts != ')') {
30696 0 : PyErr_Format(PyExc_ValueError,
30697 : "Expected a comma in format string, got '%c'", *ts);
30698 0 : return -1;
30699 : }
30700 0 : if (*ts == ',') ts++;
30701 0 : i++;
30702 : }
30703 0 : if (i != ndim) {
30704 0 : PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
30705 0 : ctx->head->field->type->ndim, i);
30706 0 : return -1;
30707 : }
30708 0 : if (!*ts) {
30709 0 : PyErr_SetString(PyExc_ValueError,
30710 : "Unexpected end of format string, expected ')'");
30711 0 : return -1;
30712 : }
30713 0 : ctx->is_valid_array = 1;
30714 0 : ctx->new_count = 1;
30715 0 : *tsp = ++ts;
30716 0 : return 0;
30717 : }
30718 30 : static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
30719 30 : int got_Z = 0;
30720 60 : while (1) {
30721 60 : switch(*ts) {
30722 30 : case 0:
30723 30 : if (ctx->enc_type != 0 && ctx->head == NULL) {
30724 0 : __Pyx_BufFmt_RaiseExpected(ctx);
30725 0 : return NULL;
30726 : }
30727 30 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
30728 30 : if (ctx->head != NULL) {
30729 0 : __Pyx_BufFmt_RaiseExpected(ctx);
30730 0 : return NULL;
30731 : }
30732 : return ts;
30733 0 : case ' ':
30734 : case '\r':
30735 : case '\n':
30736 0 : ++ts;
30737 0 : break;
30738 : case '<':
30739 0 : if (!__Pyx_Is_Little_Endian()) {
30740 : PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
30741 : return NULL;
30742 : }
30743 0 : ctx->new_packmode = '=';
30744 0 : ++ts;
30745 0 : break;
30746 : case '>':
30747 : case '!':
30748 0 : if (__Pyx_Is_Little_Endian()) {
30749 0 : PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
30750 0 : return NULL;
30751 : }
30752 : ctx->new_packmode = '=';
30753 : ++ts;
30754 : break;
30755 0 : case '=':
30756 : case '@':
30757 : case '^':
30758 0 : ctx->new_packmode = *ts++;
30759 0 : break;
30760 0 : case 'T':
30761 : {
30762 0 : const char* ts_after_sub;
30763 0 : size_t i, struct_count = ctx->new_count;
30764 0 : size_t struct_alignment = ctx->struct_alignment;
30765 0 : ctx->new_count = 1;
30766 0 : ++ts;
30767 0 : if (*ts != '{') {
30768 0 : PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
30769 0 : return NULL;
30770 : }
30771 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
30772 0 : ctx->enc_type = 0;
30773 0 : ctx->enc_count = 0;
30774 0 : ctx->struct_alignment = 0;
30775 0 : ++ts;
30776 0 : ts_after_sub = ts;
30777 0 : for (i = 0; i != struct_count; ++i) {
30778 0 : ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
30779 0 : if (!ts_after_sub) return NULL;
30780 : }
30781 0 : ts = ts_after_sub;
30782 0 : if (struct_alignment) ctx->struct_alignment = struct_alignment;
30783 : }
30784 : break;
30785 0 : case '}':
30786 : {
30787 0 : size_t alignment = ctx->struct_alignment;
30788 0 : ++ts;
30789 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
30790 0 : ctx->enc_type = 0;
30791 0 : if (alignment && ctx->fmt_offset % alignment) {
30792 0 : ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
30793 : }
30794 : }
30795 : return ts;
30796 0 : case 'x':
30797 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
30798 0 : ctx->fmt_offset += ctx->new_count;
30799 0 : ctx->new_count = 1;
30800 0 : ctx->enc_count = 0;
30801 0 : ctx->enc_type = 0;
30802 0 : ctx->enc_packmode = ctx->new_packmode;
30803 0 : ++ts;
30804 0 : break;
30805 0 : case 'Z':
30806 0 : got_Z = 1;
30807 0 : ++ts;
30808 0 : if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
30809 0 : __Pyx_BufFmt_RaiseUnexpectedChar('Z');
30810 0 : return NULL;
30811 : }
30812 30 : CYTHON_FALLTHROUGH;
30813 : case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
30814 : case 'l': case 'L': case 'q': case 'Q':
30815 : case 'f': case 'd': case 'g':
30816 : case 'O': case 'p':
30817 30 : if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
30818 0 : (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
30819 0 : ctx->enc_count += ctx->new_count;
30820 0 : ctx->new_count = 1;
30821 0 : got_Z = 0;
30822 0 : ++ts;
30823 0 : break;
30824 : }
30825 30 : CYTHON_FALLTHROUGH;
30826 : case 's':
30827 30 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
30828 30 : ctx->enc_count = ctx->new_count;
30829 30 : ctx->enc_packmode = ctx->new_packmode;
30830 30 : ctx->enc_type = *ts;
30831 30 : ctx->is_complex = got_Z;
30832 30 : ++ts;
30833 30 : ctx->new_count = 1;
30834 30 : got_Z = 0;
30835 30 : break;
30836 0 : case ':':
30837 0 : ++ts;
30838 0 : while(*ts != ':') ++ts;
30839 0 : ++ts;
30840 0 : break;
30841 0 : case '(':
30842 0 : if (__pyx_buffmt_parse_array(ctx, &ts) < 0) return NULL;
30843 : break;
30844 0 : default:
30845 : {
30846 0 : int number = __Pyx_BufFmt_ExpectNumber(&ts);
30847 0 : if (number == -1) return NULL;
30848 0 : ctx->new_count = (size_t)number;
30849 : }
30850 : }
30851 : }
30852 : }
30853 :
30854 : /* BufferGetAndValidate */
30855 30 : static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
30856 30 : if (unlikely(info->buf == NULL)) return;
30857 30 : if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
30858 30 : __Pyx_ReleaseBuffer(info);
30859 : }
30860 0 : static void __Pyx_ZeroBuffer(Py_buffer* buf) {
30861 0 : buf->buf = NULL;
30862 0 : buf->obj = NULL;
30863 0 : buf->strides = __Pyx_zeros;
30864 0 : buf->shape = __Pyx_zeros;
30865 0 : buf->suboffsets = __Pyx_minusones;
30866 : }
30867 30 : static int __Pyx__GetBufferAndValidate(
30868 : Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags,
30869 : int nd, int cast, __Pyx_BufFmt_StackElem* stack)
30870 : {
30871 30 : buf->buf = NULL;
30872 30 : if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
30873 0 : __Pyx_ZeroBuffer(buf);
30874 0 : return -1;
30875 : }
30876 30 : if (unlikely(buf->ndim != nd)) {
30877 0 : PyErr_Format(PyExc_ValueError,
30878 : "Buffer has wrong number of dimensions (expected %d, got %d)",
30879 : nd, buf->ndim);
30880 0 : goto fail;
30881 : }
30882 30 : if (!cast) {
30883 30 : __Pyx_BufFmt_Context ctx;
30884 30 : __Pyx_BufFmt_Init(&ctx, stack, dtype);
30885 30 : if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
30886 : }
30887 30 : if (unlikely((size_t)buf->itemsize != dtype->size)) {
30888 0 : PyErr_Format(PyExc_ValueError,
30889 : "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
30890 : buf->itemsize, (buf->itemsize > 1) ? "s" : "",
30891 : dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
30892 0 : goto fail;
30893 : }
30894 30 : if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
30895 : return 0;
30896 0 : fail:;
30897 0 : __Pyx_SafeReleaseBuffer(buf);
30898 0 : return -1;
30899 : }
30900 :
30901 : /* BufferIndexError */
30902 0 : static void __Pyx_RaiseBufferIndexError(int axis) {
30903 0 : PyErr_Format(PyExc_IndexError,
30904 : "Out of bounds on buffer access (axis %d)", axis);
30905 : }
30906 :
30907 : /* DictGetItem */
30908 : #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
30909 3 : static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
30910 3 : PyObject *value;
30911 3 : value = PyDict_GetItemWithError(d, key);
30912 3 : if (unlikely(!value)) {
30913 0 : if (!PyErr_Occurred()) {
30914 0 : if (unlikely(PyTuple_Check(key))) {
30915 0 : PyObject* args = PyTuple_Pack(1, key);
30916 0 : if (likely(args)) {
30917 0 : PyErr_SetObject(PyExc_KeyError, args);
30918 0 : Py_DECREF(args);
30919 : }
30920 : } else {
30921 0 : PyErr_SetObject(PyExc_KeyError, key);
30922 : }
30923 : }
30924 0 : return NULL;
30925 : }
30926 3 : Py_INCREF(value);
30927 : return value;
30928 : }
30929 : #endif
30930 :
30931 : /* UnicodeAsUCS4 */
30932 3 : static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) {
30933 3 : Py_ssize_t length;
30934 : #if CYTHON_PEP393_ENABLED
30935 3 : length = PyUnicode_GET_LENGTH(x);
30936 3 : if (likely(length == 1)) {
30937 3 : return PyUnicode_READ_CHAR(x, 0);
30938 : }
30939 : #else
30940 : length = PyUnicode_GET_SIZE(x);
30941 : if (likely(length == 1)) {
30942 : return PyUnicode_AS_UNICODE(x)[0];
30943 : }
30944 : #if Py_UNICODE_SIZE == 2
30945 : else if (PyUnicode_GET_SIZE(x) == 2) {
30946 : Py_UCS4 high_val = PyUnicode_AS_UNICODE(x)[0];
30947 : if (high_val >= 0xD800 && high_val <= 0xDBFF) {
30948 : Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1];
30949 : if (low_val >= 0xDC00 && low_val <= 0xDFFF) {
30950 : return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1)));
30951 : }
30952 : }
30953 : }
30954 : #endif
30955 : #endif
30956 0 : PyErr_Format(PyExc_ValueError,
30957 : "only single character unicode strings can be converted to Py_UCS4, "
30958 : "got length %" CYTHON_FORMAT_SSIZE_T "d", length);
30959 0 : return (Py_UCS4)-1;
30960 : }
30961 :
30962 : /* object_ord */
30963 0 : static long __Pyx__PyObject_Ord(PyObject* c) {
30964 0 : Py_ssize_t size;
30965 0 : if (PyBytes_Check(c)) {
30966 0 : size = PyBytes_GET_SIZE(c);
30967 0 : if (likely(size == 1)) {
30968 0 : return (unsigned char) PyBytes_AS_STRING(c)[0];
30969 : }
30970 : #if PY_MAJOR_VERSION < 3
30971 : } else if (PyUnicode_Check(c)) {
30972 : return (long)__Pyx_PyUnicode_AsPy_UCS4(c);
30973 : #endif
30974 : #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
30975 0 : } else if (PyByteArray_Check(c)) {
30976 0 : size = PyByteArray_GET_SIZE(c);
30977 0 : if (likely(size == 1)) {
30978 0 : return (unsigned char) PyByteArray_AS_STRING(c)[0];
30979 : }
30980 : #endif
30981 : } else {
30982 0 : __Pyx_TypeName c_type_name = __Pyx_PyType_GetName(Py_TYPE(c));
30983 0 : PyErr_Format(PyExc_TypeError,
30984 : "ord() expected string of length 1, but " __Pyx_FMT_TYPENAME " found",
30985 : c_type_name);
30986 0 : __Pyx_DECREF_TypeName(c_type_name);
30987 0 : return (long)(Py_UCS4)-1;
30988 : }
30989 0 : PyErr_Format(PyExc_TypeError,
30990 : "ord() expected a character, but string of length %zd found", size);
30991 0 : return (long)(Py_UCS4)-1;
30992 : }
30993 :
30994 : /* memoryview_get_from_buffer */
30995 : #if !CYTHON_COMPILING_IN_LIMITED_API || CYTHON_LIMITED_API >= 0x030b0000
30996 : #else
30997 : static Py_ssize_t __Pyx_PyMemoryView_Get_itemsize(PyObject *obj) {
30998 : Py_ssize_t result;
30999 : PyObject *attr = PyObject_GetAttr(obj, __pyx_n_s_itemsize);
31000 : if (!attr) {
31001 : goto bad;
31002 : }
31003 : result = PyLong_AsSsize_t(attr);
31004 : Py_DECREF(attr);
31005 : return result;
31006 : bad:
31007 : Py_XDECREF(attr);
31008 : return -1;
31009 : }
31010 : #endif
31011 :
31012 : /* memoryview_get_from_buffer */
31013 : #if !CYTHON_COMPILING_IN_LIMITED_API || CYTHON_LIMITED_API >= 0x030b0000
31014 : #else
31015 : static int __Pyx_PyMemoryView_Get_ndim(PyObject *obj) {
31016 : int result;
31017 : PyObject *attr = PyObject_GetAttr(obj, __pyx_n_s_ndim);
31018 : if (!attr) {
31019 : goto bad;
31020 : }
31021 : result = PyLong_AsLong(attr);
31022 : Py_DECREF(attr);
31023 : return result;
31024 : bad:
31025 : Py_XDECREF(attr);
31026 : return -1;
31027 : }
31028 : #endif
31029 :
31030 : /* IterFinish */
31031 0 : static CYTHON_INLINE int __Pyx_IterFinish(void) {
31032 0 : PyObject* exc_type;
31033 0 : __Pyx_PyThreadState_declare
31034 0 : __Pyx_PyThreadState_assign
31035 0 : exc_type = __Pyx_PyErr_CurrentExceptionType();
31036 0 : if (unlikely(exc_type)) {
31037 0 : if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
31038 : return -1;
31039 0 : __Pyx_PyErr_Clear();
31040 0 : return 0;
31041 : }
31042 : return 0;
31043 : }
31044 :
31045 : /* PyObjectCallNoArg */
31046 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
31047 : PyObject *arg[2] = {NULL, NULL};
31048 : return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
31049 : }
31050 :
31051 : /* PyObjectGetMethod */
31052 : static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
31053 : PyObject *attr;
31054 : #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
31055 : __Pyx_TypeName type_name;
31056 : PyTypeObject *tp = Py_TYPE(obj);
31057 : PyObject *descr;
31058 : descrgetfunc f = NULL;
31059 : PyObject **dictptr, *dict;
31060 : int meth_found = 0;
31061 : assert (*method == NULL);
31062 : if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
31063 : attr = __Pyx_PyObject_GetAttrStr(obj, name);
31064 : goto try_unpack;
31065 : }
31066 : if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
31067 : return 0;
31068 : }
31069 : descr = _PyType_Lookup(tp, name);
31070 : if (likely(descr != NULL)) {
31071 : Py_INCREF(descr);
31072 : #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
31073 : if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
31074 : #elif PY_MAJOR_VERSION >= 3
31075 : #ifdef __Pyx_CyFunction_USED
31076 : if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
31077 : #else
31078 : if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
31079 : #endif
31080 : #else
31081 : #ifdef __Pyx_CyFunction_USED
31082 : if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
31083 : #else
31084 : if (likely(PyFunction_Check(descr)))
31085 : #endif
31086 : #endif
31087 : {
31088 : meth_found = 1;
31089 : } else {
31090 : f = Py_TYPE(descr)->tp_descr_get;
31091 : if (f != NULL && PyDescr_IsData(descr)) {
31092 : attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
31093 : Py_DECREF(descr);
31094 : goto try_unpack;
31095 : }
31096 : }
31097 : }
31098 : dictptr = _PyObject_GetDictPtr(obj);
31099 : if (dictptr != NULL && (dict = *dictptr) != NULL) {
31100 : Py_INCREF(dict);
31101 : attr = __Pyx_PyDict_GetItemStr(dict, name);
31102 : if (attr != NULL) {
31103 : Py_INCREF(attr);
31104 : Py_DECREF(dict);
31105 : Py_XDECREF(descr);
31106 : goto try_unpack;
31107 : }
31108 : Py_DECREF(dict);
31109 : }
31110 : if (meth_found) {
31111 : *method = descr;
31112 : return 1;
31113 : }
31114 : if (f != NULL) {
31115 : attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
31116 : Py_DECREF(descr);
31117 : goto try_unpack;
31118 : }
31119 : if (likely(descr != NULL)) {
31120 : *method = descr;
31121 : return 0;
31122 : }
31123 : type_name = __Pyx_PyType_GetName(tp);
31124 : PyErr_Format(PyExc_AttributeError,
31125 : #if PY_MAJOR_VERSION >= 3
31126 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
31127 : type_name, name);
31128 : #else
31129 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
31130 : type_name, PyString_AS_STRING(name));
31131 : #endif
31132 : __Pyx_DECREF_TypeName(type_name);
31133 : return 0;
31134 : #else
31135 : attr = __Pyx_PyObject_GetAttrStr(obj, name);
31136 : goto try_unpack;
31137 : #endif
31138 : try_unpack:
31139 : #if CYTHON_UNPACK_METHODS
31140 : if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
31141 : PyObject *function = PyMethod_GET_FUNCTION(attr);
31142 : Py_INCREF(function);
31143 : Py_DECREF(attr);
31144 : *method = function;
31145 : return 1;
31146 : }
31147 : #endif
31148 : *method = attr;
31149 : return 0;
31150 : }
31151 :
31152 : /* PyObjectCallMethod0 */
31153 : static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
31154 : PyObject *method = NULL, *result = NULL;
31155 : int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
31156 : if (likely(is_method)) {
31157 : result = __Pyx_PyObject_CallOneArg(method, obj);
31158 : Py_DECREF(method);
31159 : return result;
31160 : }
31161 : if (unlikely(!method)) goto bad;
31162 : result = __Pyx_PyObject_CallNoArg(method);
31163 : Py_DECREF(method);
31164 : bad:
31165 : return result;
31166 : }
31167 :
31168 : /* UnpackItemEndCheck */
31169 0 : static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
31170 0 : if (unlikely(retval)) {
31171 0 : Py_DECREF(retval);
31172 0 : __Pyx_RaiseTooManyValuesError(expected);
31173 0 : return -1;
31174 : }
31175 0 : return __Pyx_IterFinish();
31176 : }
31177 :
31178 : /* UnpackTupleError */
31179 0 : static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
31180 0 : if (t == Py_None) {
31181 0 : __Pyx_RaiseNoneNotIterableError();
31182 0 : } else if (PyTuple_GET_SIZE(t) < index) {
31183 0 : __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
31184 : } else {
31185 0 : __Pyx_RaiseTooManyValuesError(index);
31186 : }
31187 0 : }
31188 :
31189 : /* UnpackTuple2 */
31190 0 : static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
31191 : PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
31192 0 : PyObject *value1 = NULL, *value2 = NULL;
31193 : #if CYTHON_COMPILING_IN_PYPY
31194 : value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad;
31195 : value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad;
31196 : #else
31197 0 : value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1);
31198 0 : value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2);
31199 : #endif
31200 0 : if (decref_tuple) {
31201 0 : Py_DECREF(tuple);
31202 : }
31203 0 : *pvalue1 = value1;
31204 0 : *pvalue2 = value2;
31205 0 : return 0;
31206 : #if CYTHON_COMPILING_IN_PYPY
31207 : bad:
31208 : Py_XDECREF(value1);
31209 : Py_XDECREF(value2);
31210 : if (decref_tuple) { Py_XDECREF(tuple); }
31211 : return -1;
31212 : #endif
31213 : }
31214 0 : static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
31215 : int has_known_size, int decref_tuple) {
31216 0 : Py_ssize_t index;
31217 0 : PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
31218 0 : iternextfunc iternext;
31219 0 : iter = PyObject_GetIter(tuple);
31220 0 : if (unlikely(!iter)) goto bad;
31221 0 : if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
31222 0 : iternext = __Pyx_PyObject_GetIterNextFunc(iter);
31223 0 : value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
31224 0 : value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
31225 0 : if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
31226 0 : Py_DECREF(iter);
31227 0 : *pvalue1 = value1;
31228 0 : *pvalue2 = value2;
31229 0 : return 0;
31230 0 : unpacking_failed:
31231 0 : if (!has_known_size && __Pyx_IterFinish() == 0)
31232 0 : __Pyx_RaiseNeedMoreValuesError(index);
31233 0 : bad:
31234 0 : Py_XDECREF(iter);
31235 0 : Py_XDECREF(value1);
31236 0 : Py_XDECREF(value2);
31237 0 : if (decref_tuple) { Py_XDECREF(tuple); }
31238 : return -1;
31239 : }
31240 :
31241 : /* dict_iter */
31242 : #if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
31243 : #include <string.h>
31244 : #endif
31245 1 : static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
31246 : Py_ssize_t* p_orig_length, int* p_source_is_dict) {
31247 1 : is_dict = is_dict || likely(PyDict_CheckExact(iterable));
31248 1 : *p_source_is_dict = is_dict;
31249 1 : if (is_dict) {
31250 : #if !CYTHON_COMPILING_IN_PYPY
31251 1 : *p_orig_length = PyDict_Size(iterable);
31252 1 : Py_INCREF(iterable);
31253 1 : return iterable;
31254 : #elif PY_MAJOR_VERSION >= 3
31255 : static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
31256 : PyObject **pp = NULL;
31257 : if (method_name) {
31258 : const char *name = PyUnicode_AsUTF8(method_name);
31259 : if (strcmp(name, "iteritems") == 0) pp = &py_items;
31260 : else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
31261 : else if (strcmp(name, "itervalues") == 0) pp = &py_values;
31262 : if (pp) {
31263 : if (!*pp) {
31264 : *pp = PyUnicode_FromString(name + 4);
31265 : if (!*pp)
31266 : return NULL;
31267 : }
31268 : method_name = *pp;
31269 : }
31270 : }
31271 : #endif
31272 : }
31273 : *p_orig_length = 0;
31274 : if (method_name) {
31275 : PyObject* iter;
31276 : iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
31277 : if (!iterable)
31278 : return NULL;
31279 : #if !CYTHON_COMPILING_IN_PYPY
31280 : if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
31281 : return iterable;
31282 : #endif
31283 : iter = PyObject_GetIter(iterable);
31284 : Py_DECREF(iterable);
31285 : return iter;
31286 : }
31287 : return PyObject_GetIter(iterable);
31288 : }
31289 3 : static CYTHON_INLINE int __Pyx_dict_iter_next(
31290 : PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
31291 : PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
31292 3 : PyObject* next_item;
31293 : #if !CYTHON_COMPILING_IN_PYPY
31294 3 : if (source_is_dict) {
31295 3 : PyObject *key, *value;
31296 3 : if (unlikely(orig_length != PyDict_Size(iter_obj))) {
31297 0 : PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
31298 0 : return -1;
31299 : }
31300 3 : if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
31301 : return 0;
31302 : }
31303 2 : if (pitem) {
31304 0 : PyObject* tuple = PyTuple_New(2);
31305 0 : if (unlikely(!tuple)) {
31306 : return -1;
31307 : }
31308 0 : Py_INCREF(key);
31309 0 : Py_INCREF(value);
31310 0 : PyTuple_SET_ITEM(tuple, 0, key);
31311 0 : PyTuple_SET_ITEM(tuple, 1, value);
31312 0 : *pitem = tuple;
31313 : } else {
31314 2 : if (pkey) {
31315 2 : Py_INCREF(key);
31316 2 : *pkey = key;
31317 : }
31318 2 : if (pvalue) {
31319 0 : Py_INCREF(value);
31320 0 : *pvalue = value;
31321 : }
31322 : }
31323 2 : return 1;
31324 0 : } else if (PyTuple_CheckExact(iter_obj)) {
31325 0 : Py_ssize_t pos = *ppos;
31326 0 : if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
31327 0 : *ppos = pos + 1;
31328 0 : next_item = PyTuple_GET_ITEM(iter_obj, pos);
31329 0 : Py_INCREF(next_item);
31330 0 : } else if (PyList_CheckExact(iter_obj)) {
31331 0 : Py_ssize_t pos = *ppos;
31332 0 : if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
31333 0 : *ppos = pos + 1;
31334 0 : next_item = PyList_GET_ITEM(iter_obj, pos);
31335 0 : Py_INCREF(next_item);
31336 : } else
31337 : #endif
31338 : {
31339 0 : next_item = PyIter_Next(iter_obj);
31340 0 : if (unlikely(!next_item)) {
31341 0 : return __Pyx_IterFinish();
31342 : }
31343 : }
31344 0 : if (pitem) {
31345 0 : *pitem = next_item;
31346 0 : } else if (pkey && pvalue) {
31347 0 : if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
31348 0 : return -1;
31349 0 : } else if (pkey) {
31350 0 : *pkey = next_item;
31351 : } else {
31352 0 : *pvalue = next_item;
31353 : }
31354 : return 1;
31355 : }
31356 :
31357 : /* UnpackUnboundCMethod */
31358 0 : static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
31359 0 : PyObject *result;
31360 0 : PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
31361 0 : if (unlikely(!selfless_args)) return NULL;
31362 0 : result = PyObject_Call(method, selfless_args, kwargs);
31363 0 : Py_DECREF(selfless_args);
31364 : return result;
31365 : }
31366 : static PyMethodDef __Pyx_UnboundCMethod_Def = {
31367 : "CythonUnboundCMethod",
31368 : __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
31369 : METH_VARARGS | METH_KEYWORDS,
31370 : NULL
31371 : };
31372 0 : static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
31373 0 : PyObject *method;
31374 0 : method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
31375 0 : if (unlikely(!method))
31376 : return -1;
31377 0 : target->method = method;
31378 : #if CYTHON_COMPILING_IN_CPYTHON
31379 : #if PY_MAJOR_VERSION >= 3
31380 0 : if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
31381 : #else
31382 : if (likely(!__Pyx_CyOrPyCFunction_Check(method)))
31383 : #endif
31384 : {
31385 0 : PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
31386 0 : target->func = descr->d_method->ml_meth;
31387 0 : target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
31388 : } else
31389 : #endif
31390 : #if CYTHON_COMPILING_IN_PYPY
31391 : #else
31392 0 : if (PyCFunction_Check(method))
31393 : #endif
31394 : {
31395 0 : PyObject *self;
31396 0 : int self_found;
31397 : #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
31398 : self = PyObject_GetAttrString(method, "__self__");
31399 : if (!self) {
31400 : PyErr_Clear();
31401 : }
31402 : #else
31403 0 : self = PyCFunction_GET_SELF(method);
31404 : #endif
31405 0 : self_found = (self && self != Py_None);
31406 : #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
31407 : Py_XDECREF(self);
31408 : #endif
31409 0 : if (self_found) {
31410 0 : PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
31411 0 : if (unlikely(!unbound_method)) return -1;
31412 0 : Py_DECREF(method);
31413 0 : target->method = unbound_method;
31414 : }
31415 : }
31416 : return 0;
31417 : }
31418 :
31419 : /* CallUnboundCMethod0 */
31420 0 : static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
31421 0 : PyObject *args, *result = NULL;
31422 0 : if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
31423 : #if CYTHON_ASSUME_SAFE_MACROS
31424 0 : args = PyTuple_New(1);
31425 0 : if (unlikely(!args)) goto bad;
31426 0 : Py_INCREF(self);
31427 0 : PyTuple_SET_ITEM(args, 0, self);
31428 : #else
31429 : args = PyTuple_Pack(1, self);
31430 : if (unlikely(!args)) goto bad;
31431 : #endif
31432 0 : result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
31433 0 : Py_DECREF(args);
31434 : bad:
31435 : return result;
31436 : }
31437 :
31438 : /* py_dict_values */
31439 0 : static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
31440 0 : if (PY_MAJOR_VERSION >= 3)
31441 0 : return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_values, d);
31442 : else
31443 : return PyDict_Values(d);
31444 : }
31445 :
31446 : /* CallUnboundCMethod1 */
31447 : #if CYTHON_COMPILING_IN_CPYTHON
31448 : static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
31449 : if (likely(cfunc->func)) {
31450 : int flag = cfunc->flag;
31451 : if (flag == METH_O) {
31452 : return (*(cfunc->func))(self, arg);
31453 : } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) {
31454 : #if PY_VERSION_HEX >= 0x030700A0
31455 : return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1);
31456 : #else
31457 : return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
31458 : #endif
31459 : } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) {
31460 : return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
31461 : }
31462 : }
31463 : return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
31464 : }
31465 : #endif
31466 : static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
31467 : PyObject *args, *result = NULL;
31468 : if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
31469 : #if CYTHON_COMPILING_IN_CPYTHON
31470 : if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
31471 : args = PyTuple_New(1);
31472 : if (unlikely(!args)) goto bad;
31473 : Py_INCREF(arg);
31474 : PyTuple_SET_ITEM(args, 0, arg);
31475 : if (cfunc->flag & METH_KEYWORDS)
31476 : result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
31477 : else
31478 : result = (*cfunc->func)(self, args);
31479 : } else {
31480 : args = PyTuple_New(2);
31481 : if (unlikely(!args)) goto bad;
31482 : Py_INCREF(self);
31483 : PyTuple_SET_ITEM(args, 0, self);
31484 : Py_INCREF(arg);
31485 : PyTuple_SET_ITEM(args, 1, arg);
31486 : result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
31487 : }
31488 : #else
31489 : args = PyTuple_Pack(2, self, arg);
31490 : if (unlikely(!args)) goto bad;
31491 : result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
31492 : #endif
31493 : bad:
31494 : Py_XDECREF(args);
31495 : return result;
31496 : }
31497 :
31498 : /* CallUnboundCMethod2 */
31499 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
31500 : static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
31501 : if (likely(cfunc->func)) {
31502 : PyObject *args[2] = {arg1, arg2};
31503 : if (cfunc->flag == METH_FASTCALL) {
31504 : #if PY_VERSION_HEX >= 0x030700A0
31505 : return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2);
31506 : #else
31507 : return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
31508 : #endif
31509 : }
31510 : #if PY_VERSION_HEX >= 0x030700A0
31511 : if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
31512 : return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
31513 : #endif
31514 : }
31515 : return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
31516 : }
31517 : #endif
31518 : static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
31519 : PyObject *args, *result = NULL;
31520 : if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
31521 : #if CYTHON_COMPILING_IN_CPYTHON
31522 : if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
31523 : args = PyTuple_New(2);
31524 : if (unlikely(!args)) goto bad;
31525 : Py_INCREF(arg1);
31526 : PyTuple_SET_ITEM(args, 0, arg1);
31527 : Py_INCREF(arg2);
31528 : PyTuple_SET_ITEM(args, 1, arg2);
31529 : if (cfunc->flag & METH_KEYWORDS)
31530 : result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
31531 : else
31532 : result = (*cfunc->func)(self, args);
31533 : } else {
31534 : args = PyTuple_New(3);
31535 : if (unlikely(!args)) goto bad;
31536 : Py_INCREF(self);
31537 : PyTuple_SET_ITEM(args, 0, self);
31538 : Py_INCREF(arg1);
31539 : PyTuple_SET_ITEM(args, 1, arg1);
31540 : Py_INCREF(arg2);
31541 : PyTuple_SET_ITEM(args, 2, arg2);
31542 : result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
31543 : }
31544 : #else
31545 : args = PyTuple_Pack(3, self, arg1, arg2);
31546 : if (unlikely(!args)) goto bad;
31547 : result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
31548 : #endif
31549 : bad:
31550 : Py_XDECREF(args);
31551 : return result;
31552 : }
31553 :
31554 : /* dict_getitem_default */
31555 3 : static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
31556 3 : PyObject* value;
31557 : #if PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
31558 3 : value = PyDict_GetItemWithError(d, key);
31559 3 : if (unlikely(!value)) {
31560 0 : if (unlikely(PyErr_Occurred()))
31561 : return NULL;
31562 : value = default_value;
31563 : }
31564 3 : Py_INCREF(value);
31565 : if ((1));
31566 : #else
31567 : if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
31568 : value = PyDict_GetItem(d, key);
31569 : if (unlikely(!value)) {
31570 : value = default_value;
31571 : }
31572 : Py_INCREF(value);
31573 : }
31574 : #endif
31575 : else {
31576 : if (default_value == Py_None)
31577 : value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key);
31578 : else
31579 : value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value);
31580 : }
31581 : return value;
31582 : }
31583 :
31584 : /* PyObject_GenericGetAttrNoDict */
31585 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
31586 : static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
31587 : __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp);
31588 : PyErr_Format(PyExc_AttributeError,
31589 : #if PY_MAJOR_VERSION >= 3
31590 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
31591 : type_name, attr_name);
31592 : #else
31593 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
31594 : type_name, PyString_AS_STRING(attr_name));
31595 : #endif
31596 : __Pyx_DECREF_TypeName(type_name);
31597 : return NULL;
31598 : }
31599 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
31600 : PyObject *descr;
31601 : PyTypeObject *tp = Py_TYPE(obj);
31602 : if (unlikely(!PyString_Check(attr_name))) {
31603 : return PyObject_GenericGetAttr(obj, attr_name);
31604 : }
31605 : assert(!tp->tp_dictoffset);
31606 : descr = _PyType_Lookup(tp, attr_name);
31607 : if (unlikely(!descr)) {
31608 : return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
31609 : }
31610 : Py_INCREF(descr);
31611 : #if PY_MAJOR_VERSION < 3
31612 : if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
31613 : #endif
31614 : {
31615 : descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
31616 : if (unlikely(f)) {
31617 : PyObject *res = f(descr, obj, (PyObject *)tp);
31618 : Py_DECREF(descr);
31619 : return res;
31620 : }
31621 : }
31622 : return descr;
31623 : }
31624 : #endif
31625 :
31626 : /* PyObject_GenericGetAttr */
31627 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
31628 : static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
31629 : if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
31630 : return PyObject_GenericGetAttr(obj, attr_name);
31631 : }
31632 : return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
31633 : }
31634 : #endif
31635 :
31636 : /* FixUpExtensionType */
31637 : #if CYTHON_USE_TYPE_SPECS
31638 : static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
31639 : #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
31640 : CYTHON_UNUSED_VAR(spec);
31641 : CYTHON_UNUSED_VAR(type);
31642 : #else
31643 : const PyType_Slot *slot = spec->slots;
31644 : while (slot && slot->slot && slot->slot != Py_tp_members)
31645 : slot++;
31646 : if (slot && slot->slot == Py_tp_members) {
31647 : int changed = 0;
31648 : #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
31649 : const
31650 : #endif
31651 : PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
31652 : while (memb && memb->name) {
31653 : if (memb->name[0] == '_' && memb->name[1] == '_') {
31654 : #if PY_VERSION_HEX < 0x030900b1
31655 : if (strcmp(memb->name, "__weaklistoffset__") == 0) {
31656 : assert(memb->type == T_PYSSIZET);
31657 : assert(memb->flags == READONLY);
31658 : type->tp_weaklistoffset = memb->offset;
31659 : changed = 1;
31660 : }
31661 : else if (strcmp(memb->name, "__dictoffset__") == 0) {
31662 : assert(memb->type == T_PYSSIZET);
31663 : assert(memb->flags == READONLY);
31664 : type->tp_dictoffset = memb->offset;
31665 : changed = 1;
31666 : }
31667 : #if CYTHON_METH_FASTCALL
31668 : else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
31669 : assert(memb->type == T_PYSSIZET);
31670 : assert(memb->flags == READONLY);
31671 : #if PY_VERSION_HEX >= 0x030800b4
31672 : type->tp_vectorcall_offset = memb->offset;
31673 : #else
31674 : type->tp_print = (printfunc) memb->offset;
31675 : #endif
31676 : changed = 1;
31677 : }
31678 : #endif
31679 : #else
31680 : if ((0));
31681 : #endif
31682 : #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
31683 : else if (strcmp(memb->name, "__module__") == 0) {
31684 : PyObject *descr;
31685 : assert(memb->type == T_OBJECT);
31686 : assert(memb->flags == 0 || memb->flags == READONLY);
31687 : descr = PyDescr_NewMember(type, memb);
31688 : if (unlikely(!descr))
31689 : return -1;
31690 : if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
31691 : Py_DECREF(descr);
31692 : return -1;
31693 : }
31694 : Py_DECREF(descr);
31695 : changed = 1;
31696 : }
31697 : #endif
31698 : }
31699 : memb++;
31700 : }
31701 : if (changed)
31702 : PyType_Modified(type);
31703 : }
31704 : #endif
31705 : return 0;
31706 : }
31707 : #endif
31708 :
31709 : /* ValidateBasesTuple */
31710 : #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
31711 0 : static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
31712 0 : Py_ssize_t i, n;
31713 : #if CYTHON_ASSUME_SAFE_MACROS
31714 0 : n = PyTuple_GET_SIZE(bases);
31715 : #else
31716 : n = PyTuple_Size(bases);
31717 : if (n < 0) return -1;
31718 : #endif
31719 0 : for (i = 1; i < n; i++)
31720 : {
31721 : #if CYTHON_AVOID_BORROWED_REFS
31722 : PyObject *b0 = PySequence_GetItem(bases, i);
31723 : if (!b0) return -1;
31724 : #elif CYTHON_ASSUME_SAFE_MACROS
31725 0 : PyObject *b0 = PyTuple_GET_ITEM(bases, i);
31726 : #else
31727 : PyObject *b0 = PyTuple_GetItem(bases, i);
31728 : if (!b0) return -1;
31729 : #endif
31730 0 : PyTypeObject *b;
31731 : #if PY_MAJOR_VERSION < 3
31732 : if (PyClass_Check(b0))
31733 : {
31734 : PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class",
31735 : PyString_AS_STRING(((PyClassObject*)b0)->cl_name));
31736 : #if CYTHON_AVOID_BORROWED_REFS
31737 : Py_DECREF(b0);
31738 : #endif
31739 : return -1;
31740 : }
31741 : #endif
31742 0 : b = (PyTypeObject*) b0;
31743 0 : if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
31744 : {
31745 0 : __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
31746 0 : PyErr_Format(PyExc_TypeError,
31747 : "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
31748 0 : __Pyx_DECREF_TypeName(b_name);
31749 : #if CYTHON_AVOID_BORROWED_REFS
31750 : Py_DECREF(b0);
31751 : #endif
31752 0 : return -1;
31753 : }
31754 0 : if (dictoffset == 0)
31755 : {
31756 0 : Py_ssize_t b_dictoffset = 0;
31757 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
31758 0 : b_dictoffset = b->tp_dictoffset;
31759 : #else
31760 : PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
31761 : if (!py_b_dictoffset) goto dictoffset_return;
31762 : b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
31763 : Py_DECREF(py_b_dictoffset);
31764 : if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
31765 : #endif
31766 0 : if (b_dictoffset) {
31767 : {
31768 0 : __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
31769 0 : PyErr_Format(PyExc_TypeError,
31770 : "extension type '%.200s' has no __dict__ slot, "
31771 : "but base type '" __Pyx_FMT_TYPENAME "' has: "
31772 : "either add 'cdef dict __dict__' to the extension type "
31773 : "or add '__slots__ = [...]' to the base type",
31774 : type_name, b_name);
31775 0 : __Pyx_DECREF_TypeName(b_name);
31776 : }
31777 : #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY)
31778 : dictoffset_return:
31779 : #endif
31780 : #if CYTHON_AVOID_BORROWED_REFS
31781 : Py_DECREF(b0);
31782 : #endif
31783 0 : return -1;
31784 : }
31785 : }
31786 : #if CYTHON_AVOID_BORROWED_REFS
31787 : Py_DECREF(b0);
31788 : #endif
31789 : }
31790 : return 0;
31791 : }
31792 : #endif
31793 :
31794 : /* PyType_Ready */
31795 12 : static int __Pyx_PyType_Ready(PyTypeObject *t) {
31796 : #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION)
31797 : (void)__Pyx_PyObject_CallMethod0;
31798 : #if CYTHON_USE_TYPE_SPECS
31799 : (void)__Pyx_validate_bases_tuple;
31800 : #endif
31801 : return PyType_Ready(t);
31802 : #else
31803 12 : int r;
31804 12 : PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
31805 12 : if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
31806 : return -1;
31807 : #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
31808 : {
31809 12 : int gc_was_enabled;
31810 : #if PY_VERSION_HEX >= 0x030A00b1
31811 12 : gc_was_enabled = PyGC_Disable();
31812 12 : (void)__Pyx_PyObject_CallMethod0;
31813 : #else
31814 : PyObject *ret, *py_status;
31815 : PyObject *gc = NULL;
31816 : #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400)
31817 : gc = PyImport_GetModule(__pyx_kp_u_gc);
31818 : #endif
31819 : if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc);
31820 : if (unlikely(!gc)) return -1;
31821 : py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled);
31822 : if (unlikely(!py_status)) {
31823 : Py_DECREF(gc);
31824 : return -1;
31825 : }
31826 : gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
31827 : Py_DECREF(py_status);
31828 : if (gc_was_enabled > 0) {
31829 : ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable);
31830 : if (unlikely(!ret)) {
31831 : Py_DECREF(gc);
31832 : return -1;
31833 : }
31834 : Py_DECREF(ret);
31835 : } else if (unlikely(gc_was_enabled == -1)) {
31836 : Py_DECREF(gc);
31837 : return -1;
31838 : }
31839 : #endif
31840 12 : t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
31841 : #if PY_VERSION_HEX >= 0x030A0000
31842 12 : t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
31843 : #endif
31844 : #else
31845 : (void)__Pyx_PyObject_CallMethod0;
31846 : #endif
31847 12 : r = PyType_Ready(t);
31848 : #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
31849 12 : t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
31850 : #if PY_VERSION_HEX >= 0x030A00b1
31851 12 : if (gc_was_enabled)
31852 12 : PyGC_Enable();
31853 : #else
31854 : if (gc_was_enabled) {
31855 : PyObject *tp, *v, *tb;
31856 : PyErr_Fetch(&tp, &v, &tb);
31857 : ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable);
31858 : if (likely(ret || r == -1)) {
31859 : Py_XDECREF(ret);
31860 : PyErr_Restore(tp, v, tb);
31861 : } else {
31862 : Py_XDECREF(tp);
31863 : Py_XDECREF(v);
31864 : Py_XDECREF(tb);
31865 : r = -1;
31866 : }
31867 : }
31868 : Py_DECREF(gc);
31869 : #endif
31870 : }
31871 : #endif
31872 : return r;
31873 : #endif
31874 : }
31875 :
31876 : /* SetVTable */
31877 9 : static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
31878 9 : PyObject *ob = PyCapsule_New(vtable, 0, 0);
31879 9 : if (unlikely(!ob))
31880 0 : goto bad;
31881 : #if CYTHON_COMPILING_IN_LIMITED_API
31882 : if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0))
31883 : #else
31884 9 : if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0))
31885 : #endif
31886 0 : goto bad;
31887 9 : Py_DECREF(ob);
31888 : return 0;
31889 0 : bad:
31890 0 : Py_XDECREF(ob);
31891 0 : return -1;
31892 : }
31893 :
31894 : /* GetVTable */
31895 0 : static void* __Pyx_GetVtable(PyTypeObject *type) {
31896 0 : void* ptr;
31897 : #if CYTHON_COMPILING_IN_LIMITED_API
31898 : PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable);
31899 : #else
31900 0 : PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable);
31901 : #endif
31902 0 : if (!ob)
31903 0 : goto bad;
31904 0 : ptr = PyCapsule_GetPointer(ob, 0);
31905 0 : if (!ptr && !PyErr_Occurred())
31906 0 : PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
31907 0 : Py_DECREF(ob);
31908 : return ptr;
31909 0 : bad:
31910 0 : Py_XDECREF(ob);
31911 0 : return NULL;
31912 : }
31913 :
31914 : /* MergeVTables */
31915 : #if !CYTHON_COMPILING_IN_LIMITED_API
31916 9 : static int __Pyx_MergeVtables(PyTypeObject *type) {
31917 9 : int i;
31918 9 : void** base_vtables;
31919 9 : __Pyx_TypeName tp_base_name;
31920 9 : __Pyx_TypeName base_name;
31921 9 : void* unknown = (void*)-1;
31922 9 : PyObject* bases = type->tp_bases;
31923 9 : int base_depth = 0;
31924 : {
31925 9 : PyTypeObject* base = type->tp_base;
31926 21 : while (base) {
31927 12 : base_depth += 1;
31928 12 : base = base->tp_base;
31929 : }
31930 : }
31931 9 : base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1));
31932 9 : base_vtables[0] = unknown;
31933 9 : for (i = 1; i < PyTuple_GET_SIZE(bases); i++) {
31934 0 : void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i)));
31935 0 : if (base_vtable != NULL) {
31936 0 : int j;
31937 0 : PyTypeObject* base = type->tp_base;
31938 0 : for (j = 0; j < base_depth; j++) {
31939 0 : if (base_vtables[j] == unknown) {
31940 0 : base_vtables[j] = __Pyx_GetVtable(base);
31941 0 : base_vtables[j + 1] = unknown;
31942 : }
31943 0 : if (base_vtables[j] == base_vtable) {
31944 : break;
31945 0 : } else if (base_vtables[j] == NULL) {
31946 0 : goto bad;
31947 : }
31948 0 : base = base->tp_base;
31949 : }
31950 : }
31951 : }
31952 9 : PyErr_Clear();
31953 9 : free(base_vtables);
31954 9 : return 0;
31955 0 : bad:
31956 0 : tp_base_name = __Pyx_PyType_GetName(type->tp_base);
31957 0 : base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i));
31958 0 : PyErr_Format(PyExc_TypeError,
31959 : "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
31960 0 : __Pyx_DECREF_TypeName(tp_base_name);
31961 0 : __Pyx_DECREF_TypeName(base_name);
31962 0 : free(base_vtables);
31963 0 : return -1;
31964 : }
31965 : #endif
31966 :
31967 : /* SetupReduce */
31968 : #if !CYTHON_COMPILING_IN_LIMITED_API
31969 6 : static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
31970 6 : int ret;
31971 6 : PyObject *name_attr;
31972 6 : name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name_2);
31973 6 : if (likely(name_attr)) {
31974 6 : ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
31975 : } else {
31976 : ret = -1;
31977 : }
31978 6 : if (unlikely(ret < 0)) {
31979 0 : PyErr_Clear();
31980 0 : ret = 0;
31981 : }
31982 6 : Py_XDECREF(name_attr);
31983 6 : return ret;
31984 : }
31985 12 : static int __Pyx_setup_reduce(PyObject* type_obj) {
31986 12 : int ret = 0;
31987 12 : PyObject *object_reduce = NULL;
31988 12 : PyObject *object_getstate = NULL;
31989 12 : PyObject *object_reduce_ex = NULL;
31990 12 : PyObject *reduce = NULL;
31991 12 : PyObject *reduce_ex = NULL;
31992 12 : PyObject *reduce_cython = NULL;
31993 12 : PyObject *setstate = NULL;
31994 12 : PyObject *setstate_cython = NULL;
31995 12 : PyObject *getstate = NULL;
31996 : #if CYTHON_USE_PYTYPE_LOOKUP
31997 12 : getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
31998 : #else
31999 : getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
32000 : if (!getstate && PyErr_Occurred()) {
32001 : goto __PYX_BAD;
32002 : }
32003 : #endif
32004 12 : if (getstate) {
32005 : #if CYTHON_USE_PYTYPE_LOOKUP
32006 12 : object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
32007 : #else
32008 : object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
32009 : if (!object_getstate && PyErr_Occurred()) {
32010 : goto __PYX_BAD;
32011 : }
32012 : #endif
32013 12 : if (object_getstate != getstate) {
32014 0 : goto __PYX_GOOD;
32015 : }
32016 : }
32017 : #if CYTHON_USE_PYTYPE_LOOKUP
32018 12 : object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
32019 : #else
32020 : object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
32021 : #endif
32022 12 : reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
32023 12 : if (reduce_ex == object_reduce_ex) {
32024 : #if CYTHON_USE_PYTYPE_LOOKUP
32025 12 : object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
32026 : #else
32027 : object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
32028 : #endif
32029 12 : reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
32030 12 : if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
32031 12 : reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
32032 12 : if (likely(reduce_cython)) {
32033 12 : ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
32034 12 : ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
32035 0 : } else if (reduce == object_reduce || PyErr_Occurred()) {
32036 0 : goto __PYX_BAD;
32037 : }
32038 12 : setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate);
32039 12 : if (!setstate) PyErr_Clear();
32040 12 : if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
32041 12 : setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
32042 12 : if (likely(setstate_cython)) {
32043 12 : ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
32044 12 : ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
32045 0 : } else if (!setstate || PyErr_Occurred()) {
32046 0 : goto __PYX_BAD;
32047 : }
32048 : }
32049 12 : PyType_Modified((PyTypeObject*)type_obj);
32050 : }
32051 : }
32052 12 : goto __PYX_GOOD;
32053 0 : __PYX_BAD:
32054 0 : if (!PyErr_Occurred()) {
32055 0 : __Pyx_TypeName type_obj_name =
32056 : __Pyx_PyType_GetName((PyTypeObject*)type_obj);
32057 0 : PyErr_Format(PyExc_RuntimeError,
32058 : "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
32059 : __Pyx_DECREF_TypeName(type_obj_name);
32060 : }
32061 : ret = -1;
32062 12 : __PYX_GOOD:
32063 : #if !CYTHON_USE_PYTYPE_LOOKUP
32064 : Py_XDECREF(object_reduce);
32065 : Py_XDECREF(object_reduce_ex);
32066 : Py_XDECREF(object_getstate);
32067 : Py_XDECREF(getstate);
32068 : #endif
32069 12 : Py_XDECREF(reduce);
32070 12 : Py_XDECREF(reduce_ex);
32071 12 : Py_XDECREF(reduce_cython);
32072 12 : Py_XDECREF(setstate);
32073 12 : Py_XDECREF(setstate_cython);
32074 12 : return ret;
32075 : }
32076 : #endif
32077 :
32078 : /* TypeImport */
32079 : #ifndef __PYX_HAVE_RT_ImportType_3_0_11
32080 : #define __PYX_HAVE_RT_ImportType_3_0_11
32081 48 : static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject *module, const char *module_name, const char *class_name,
32082 : size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size)
32083 : {
32084 48 : PyObject *result = 0;
32085 48 : char warning[200];
32086 48 : Py_ssize_t basicsize;
32087 48 : Py_ssize_t itemsize;
32088 : #if CYTHON_COMPILING_IN_LIMITED_API
32089 : PyObject *py_basicsize;
32090 : PyObject *py_itemsize;
32091 : #endif
32092 48 : result = PyObject_GetAttrString(module, class_name);
32093 48 : if (!result)
32094 0 : goto bad;
32095 48 : if (!PyType_Check(result)) {
32096 0 : PyErr_Format(PyExc_TypeError,
32097 : "%.200s.%.200s is not a type object",
32098 : module_name, class_name);
32099 0 : goto bad;
32100 : }
32101 : #if !CYTHON_COMPILING_IN_LIMITED_API
32102 48 : basicsize = ((PyTypeObject *)result)->tp_basicsize;
32103 48 : itemsize = ((PyTypeObject *)result)->tp_itemsize;
32104 : #else
32105 : py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
32106 : if (!py_basicsize)
32107 : goto bad;
32108 : basicsize = PyLong_AsSsize_t(py_basicsize);
32109 : Py_DECREF(py_basicsize);
32110 : py_basicsize = 0;
32111 : if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
32112 : goto bad;
32113 : py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
32114 : if (!py_itemsize)
32115 : goto bad;
32116 : itemsize = PyLong_AsSsize_t(py_itemsize);
32117 : Py_DECREF(py_itemsize);
32118 : py_itemsize = 0;
32119 : if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
32120 : goto bad;
32121 : #endif
32122 48 : if (itemsize) {
32123 3 : if (size % alignment) {
32124 0 : alignment = size % alignment;
32125 : }
32126 3 : if (itemsize < (Py_ssize_t)alignment)
32127 : itemsize = (Py_ssize_t)alignment;
32128 : }
32129 48 : if ((size_t)(basicsize + itemsize) < size) {
32130 0 : PyErr_Format(PyExc_ValueError,
32131 : "%.200s.%.200s size changed, may indicate binary incompatibility. "
32132 : "Expected %zd from C header, got %zd from PyObject",
32133 : module_name, class_name, size, basicsize+itemsize);
32134 0 : goto bad;
32135 : }
32136 48 : if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_11 &&
32137 0 : ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
32138 0 : PyErr_Format(PyExc_ValueError,
32139 : "%.200s.%.200s size changed, may indicate binary incompatibility. "
32140 : "Expected %zd from C header, got %zd-%zd from PyObject",
32141 : module_name, class_name, size, basicsize, basicsize+itemsize);
32142 0 : goto bad;
32143 : }
32144 48 : else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_11 && (size_t)basicsize > size) {
32145 0 : PyOS_snprintf(warning, sizeof(warning),
32146 : "%s.%s size changed, may indicate binary incompatibility. "
32147 : "Expected %zd from C header, got %zd from PyObject",
32148 : module_name, class_name, size, basicsize);
32149 0 : if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
32150 : }
32151 : return (PyTypeObject *)result;
32152 0 : bad:
32153 0 : Py_XDECREF(result);
32154 0 : return NULL;
32155 : }
32156 : #endif
32157 :
32158 : /* FetchSharedCythonModule */
32159 6 : static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
32160 6 : return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
32161 : }
32162 :
32163 : /* FetchCommonType */
32164 6 : static int __Pyx_VerifyCachedType(PyObject *cached_type,
32165 : const char *name,
32166 : Py_ssize_t basicsize,
32167 : Py_ssize_t expected_basicsize) {
32168 6 : if (!PyType_Check(cached_type)) {
32169 0 : PyErr_Format(PyExc_TypeError,
32170 : "Shared Cython type %.200s is not a type object", name);
32171 0 : return -1;
32172 : }
32173 6 : if (basicsize != expected_basicsize) {
32174 0 : PyErr_Format(PyExc_TypeError,
32175 : "Shared Cython type %.200s has the wrong size, try recompiling",
32176 : name);
32177 0 : return -1;
32178 : }
32179 : return 0;
32180 : }
32181 : #if !CYTHON_USE_TYPE_SPECS
32182 6 : static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
32183 6 : PyObject* abi_module;
32184 6 : const char* object_name;
32185 6 : PyTypeObject *cached_type = NULL;
32186 6 : abi_module = __Pyx_FetchSharedCythonABIModule();
32187 6 : if (!abi_module) return NULL;
32188 6 : object_name = strrchr(type->tp_name, '.');
32189 6 : object_name = object_name ? object_name+1 : type->tp_name;
32190 6 : cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name);
32191 6 : if (cached_type) {
32192 6 : if (__Pyx_VerifyCachedType(
32193 : (PyObject *)cached_type,
32194 : object_name,
32195 : cached_type->tp_basicsize,
32196 : type->tp_basicsize) < 0) {
32197 0 : goto bad;
32198 : }
32199 6 : goto done;
32200 : }
32201 0 : if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
32202 0 : PyErr_Clear();
32203 0 : if (PyType_Ready(type) < 0) goto bad;
32204 0 : if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0)
32205 0 : goto bad;
32206 0 : Py_INCREF(type);
32207 : cached_type = type;
32208 6 : done:
32209 6 : Py_DECREF(abi_module);
32210 : return cached_type;
32211 0 : bad:
32212 0 : Py_XDECREF(cached_type);
32213 0 : cached_type = NULL;
32214 0 : goto done;
32215 : }
32216 : #else
32217 : static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
32218 : PyObject *abi_module, *cached_type = NULL;
32219 : const char* object_name = strrchr(spec->name, '.');
32220 : object_name = object_name ? object_name+1 : spec->name;
32221 : abi_module = __Pyx_FetchSharedCythonABIModule();
32222 : if (!abi_module) return NULL;
32223 : cached_type = PyObject_GetAttrString(abi_module, object_name);
32224 : if (cached_type) {
32225 : Py_ssize_t basicsize;
32226 : #if CYTHON_COMPILING_IN_LIMITED_API
32227 : PyObject *py_basicsize;
32228 : py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
32229 : if (unlikely(!py_basicsize)) goto bad;
32230 : basicsize = PyLong_AsSsize_t(py_basicsize);
32231 : Py_DECREF(py_basicsize);
32232 : py_basicsize = 0;
32233 : if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
32234 : #else
32235 : basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1;
32236 : #endif
32237 : if (__Pyx_VerifyCachedType(
32238 : cached_type,
32239 : object_name,
32240 : basicsize,
32241 : spec->basicsize) < 0) {
32242 : goto bad;
32243 : }
32244 : goto done;
32245 : }
32246 : if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
32247 : PyErr_Clear();
32248 : CYTHON_UNUSED_VAR(module);
32249 : cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
32250 : if (unlikely(!cached_type)) goto bad;
32251 : if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
32252 : if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad;
32253 : done:
32254 : Py_DECREF(abi_module);
32255 : assert(cached_type == NULL || PyType_Check(cached_type));
32256 : return (PyTypeObject *) cached_type;
32257 : bad:
32258 : Py_XDECREF(cached_type);
32259 : cached_type = NULL;
32260 : goto done;
32261 : }
32262 : #endif
32263 :
32264 : /* PyVectorcallFastCallDict */
32265 : #if CYTHON_METH_FASTCALL
32266 0 : static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
32267 : {
32268 0 : PyObject *res = NULL;
32269 0 : PyObject *kwnames;
32270 0 : PyObject **newargs;
32271 0 : PyObject **kwvalues;
32272 0 : Py_ssize_t i, pos;
32273 0 : size_t j;
32274 0 : PyObject *key, *value;
32275 0 : unsigned long keys_are_strings;
32276 0 : Py_ssize_t nkw = PyDict_GET_SIZE(kw);
32277 0 : newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
32278 0 : if (unlikely(newargs == NULL)) {
32279 0 : PyErr_NoMemory();
32280 0 : return NULL;
32281 : }
32282 0 : for (j = 0; j < nargs; j++) newargs[j] = args[j];
32283 0 : kwnames = PyTuple_New(nkw);
32284 0 : if (unlikely(kwnames == NULL)) {
32285 0 : PyMem_Free(newargs);
32286 0 : return NULL;
32287 : }
32288 0 : kwvalues = newargs + nargs;
32289 0 : pos = i = 0;
32290 0 : keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
32291 0 : while (PyDict_Next(kw, &pos, &key, &value)) {
32292 0 : keys_are_strings &= Py_TYPE(key)->tp_flags;
32293 0 : Py_INCREF(key);
32294 0 : Py_INCREF(value);
32295 0 : PyTuple_SET_ITEM(kwnames, i, key);
32296 0 : kwvalues[i] = value;
32297 0 : i++;
32298 : }
32299 0 : if (unlikely(!keys_are_strings)) {
32300 0 : PyErr_SetString(PyExc_TypeError, "keywords must be strings");
32301 0 : goto cleanup;
32302 : }
32303 0 : res = vc(func, newargs, nargs, kwnames);
32304 0 : cleanup:
32305 0 : Py_DECREF(kwnames);
32306 0 : for (i = 0; i < nkw; i++)
32307 0 : Py_DECREF(kwvalues[i]);
32308 0 : PyMem_Free(newargs);
32309 0 : return res;
32310 : }
32311 0 : static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
32312 : {
32313 0 : if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) {
32314 0 : return vc(func, args, nargs, NULL);
32315 : }
32316 0 : return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
32317 : }
32318 : #endif
32319 :
32320 : /* CythonFunctionShared */
32321 : #if CYTHON_COMPILING_IN_LIMITED_API
32322 : static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
32323 : if (__Pyx_CyFunction_Check(func)) {
32324 : return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
32325 : } else if (PyCFunction_Check(func)) {
32326 : return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
32327 : }
32328 : return 0;
32329 : }
32330 : #else
32331 : static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
32332 : return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
32333 : }
32334 : #endif
32335 0 : static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
32336 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
32337 : __Pyx_Py_XDECREF_SET(
32338 : __Pyx_CyFunction_GetClassObj(f),
32339 : ((classobj) ? __Pyx_NewRef(classobj) : NULL));
32340 : #else
32341 0 : __Pyx_Py_XDECREF_SET(
32342 : ((PyCMethodObject *) (f))->mm_class,
32343 : (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
32344 : #endif
32345 0 : }
32346 : static PyObject *
32347 0 : __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure)
32348 : {
32349 0 : CYTHON_UNUSED_VAR(closure);
32350 0 : if (unlikely(op->func_doc == NULL)) {
32351 : #if CYTHON_COMPILING_IN_LIMITED_API
32352 : op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
32353 : if (unlikely(!op->func_doc)) return NULL;
32354 : #else
32355 0 : if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
32356 : #if PY_MAJOR_VERSION >= 3
32357 0 : op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
32358 : #else
32359 : op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
32360 : #endif
32361 0 : if (unlikely(op->func_doc == NULL))
32362 : return NULL;
32363 : } else {
32364 0 : Py_INCREF(Py_None);
32365 0 : return Py_None;
32366 : }
32367 : #endif
32368 : }
32369 0 : Py_INCREF(op->func_doc);
32370 : return op->func_doc;
32371 : }
32372 : static int
32373 0 : __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
32374 : {
32375 0 : CYTHON_UNUSED_VAR(context);
32376 0 : if (value == NULL) {
32377 0 : value = Py_None;
32378 : }
32379 0 : Py_INCREF(value);
32380 0 : __Pyx_Py_XDECREF_SET(op->func_doc, value);
32381 0 : return 0;
32382 : }
32383 : static PyObject *
32384 0 : __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
32385 : {
32386 0 : CYTHON_UNUSED_VAR(context);
32387 0 : if (unlikely(op->func_name == NULL)) {
32388 : #if CYTHON_COMPILING_IN_LIMITED_API
32389 : op->func_name = PyObject_GetAttrString(op->func, "__name__");
32390 : #elif PY_MAJOR_VERSION >= 3
32391 0 : op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
32392 : #else
32393 : op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
32394 : #endif
32395 0 : if (unlikely(op->func_name == NULL))
32396 : return NULL;
32397 : }
32398 0 : Py_INCREF(op->func_name);
32399 : return op->func_name;
32400 : }
32401 : static int
32402 0 : __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
32403 : {
32404 0 : CYTHON_UNUSED_VAR(context);
32405 : #if PY_MAJOR_VERSION >= 3
32406 0 : if (unlikely(value == NULL || !PyUnicode_Check(value)))
32407 : #else
32408 : if (unlikely(value == NULL || !PyString_Check(value)))
32409 : #endif
32410 : {
32411 0 : PyErr_SetString(PyExc_TypeError,
32412 : "__name__ must be set to a string object");
32413 0 : return -1;
32414 : }
32415 0 : Py_INCREF(value);
32416 0 : __Pyx_Py_XDECREF_SET(op->func_name, value);
32417 0 : return 0;
32418 : }
32419 : static PyObject *
32420 0 : __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
32421 : {
32422 0 : CYTHON_UNUSED_VAR(context);
32423 0 : Py_INCREF(op->func_qualname);
32424 0 : return op->func_qualname;
32425 : }
32426 : static int
32427 0 : __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
32428 : {
32429 0 : CYTHON_UNUSED_VAR(context);
32430 : #if PY_MAJOR_VERSION >= 3
32431 0 : if (unlikely(value == NULL || !PyUnicode_Check(value)))
32432 : #else
32433 : if (unlikely(value == NULL || !PyString_Check(value)))
32434 : #endif
32435 : {
32436 0 : PyErr_SetString(PyExc_TypeError,
32437 : "__qualname__ must be set to a string object");
32438 0 : return -1;
32439 : }
32440 0 : Py_INCREF(value);
32441 0 : __Pyx_Py_XDECREF_SET(op->func_qualname, value);
32442 0 : return 0;
32443 : }
32444 : static PyObject *
32445 0 : __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
32446 : {
32447 0 : CYTHON_UNUSED_VAR(context);
32448 0 : if (unlikely(op->func_dict == NULL)) {
32449 0 : op->func_dict = PyDict_New();
32450 0 : if (unlikely(op->func_dict == NULL))
32451 : return NULL;
32452 : }
32453 0 : Py_INCREF(op->func_dict);
32454 : return op->func_dict;
32455 : }
32456 : static int
32457 0 : __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context)
32458 : {
32459 0 : CYTHON_UNUSED_VAR(context);
32460 0 : if (unlikely(value == NULL)) {
32461 0 : PyErr_SetString(PyExc_TypeError,
32462 : "function's dictionary may not be deleted");
32463 0 : return -1;
32464 : }
32465 0 : if (unlikely(!PyDict_Check(value))) {
32466 0 : PyErr_SetString(PyExc_TypeError,
32467 : "setting function's dictionary to a non-dict");
32468 0 : return -1;
32469 : }
32470 0 : Py_INCREF(value);
32471 0 : __Pyx_Py_XDECREF_SET(op->func_dict, value);
32472 0 : return 0;
32473 : }
32474 : static PyObject *
32475 0 : __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
32476 : {
32477 0 : CYTHON_UNUSED_VAR(context);
32478 0 : Py_INCREF(op->func_globals);
32479 0 : return op->func_globals;
32480 : }
32481 : static PyObject *
32482 0 : __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
32483 : {
32484 0 : CYTHON_UNUSED_VAR(op);
32485 0 : CYTHON_UNUSED_VAR(context);
32486 0 : Py_INCREF(Py_None);
32487 0 : return Py_None;
32488 : }
32489 : static PyObject *
32490 0 : __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
32491 : {
32492 0 : PyObject* result = (op->func_code) ? op->func_code : Py_None;
32493 0 : CYTHON_UNUSED_VAR(context);
32494 0 : Py_INCREF(result);
32495 0 : return result;
32496 : }
32497 : static int
32498 0 : __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
32499 0 : int result = 0;
32500 0 : PyObject *res = op->defaults_getter((PyObject *) op);
32501 0 : if (unlikely(!res))
32502 : return -1;
32503 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
32504 0 : op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
32505 0 : Py_INCREF(op->defaults_tuple);
32506 0 : op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
32507 0 : Py_INCREF(op->defaults_kwdict);
32508 : #else
32509 : op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
32510 : if (unlikely(!op->defaults_tuple)) result = -1;
32511 : else {
32512 : op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
32513 : if (unlikely(!op->defaults_kwdict)) result = -1;
32514 : }
32515 : #endif
32516 0 : Py_DECREF(res);
32517 : return result;
32518 : }
32519 : static int
32520 0 : __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
32521 0 : CYTHON_UNUSED_VAR(context);
32522 0 : if (!value) {
32523 : value = Py_None;
32524 0 : } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
32525 0 : PyErr_SetString(PyExc_TypeError,
32526 : "__defaults__ must be set to a tuple object");
32527 0 : return -1;
32528 : }
32529 0 : PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
32530 : "currently affect the values used in function calls", 1);
32531 0 : Py_INCREF(value);
32532 0 : __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
32533 0 : return 0;
32534 : }
32535 : static PyObject *
32536 0 : __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
32537 0 : PyObject* result = op->defaults_tuple;
32538 0 : CYTHON_UNUSED_VAR(context);
32539 0 : if (unlikely(!result)) {
32540 0 : if (op->defaults_getter) {
32541 0 : if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
32542 0 : result = op->defaults_tuple;
32543 : } else {
32544 : result = Py_None;
32545 : }
32546 : }
32547 0 : Py_INCREF(result);
32548 : return result;
32549 : }
32550 : static int
32551 0 : __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
32552 0 : CYTHON_UNUSED_VAR(context);
32553 0 : if (!value) {
32554 : value = Py_None;
32555 0 : } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
32556 0 : PyErr_SetString(PyExc_TypeError,
32557 : "__kwdefaults__ must be set to a dict object");
32558 0 : return -1;
32559 : }
32560 0 : PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
32561 : "currently affect the values used in function calls", 1);
32562 0 : Py_INCREF(value);
32563 0 : __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
32564 0 : return 0;
32565 : }
32566 : static PyObject *
32567 0 : __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
32568 0 : PyObject* result = op->defaults_kwdict;
32569 0 : CYTHON_UNUSED_VAR(context);
32570 0 : if (unlikely(!result)) {
32571 0 : if (op->defaults_getter) {
32572 0 : if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
32573 0 : result = op->defaults_kwdict;
32574 : } else {
32575 : result = Py_None;
32576 : }
32577 : }
32578 0 : Py_INCREF(result);
32579 : return result;
32580 : }
32581 : static int
32582 0 : __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
32583 0 : CYTHON_UNUSED_VAR(context);
32584 0 : if (!value || value == Py_None) {
32585 : value = NULL;
32586 0 : } else if (unlikely(!PyDict_Check(value))) {
32587 0 : PyErr_SetString(PyExc_TypeError,
32588 : "__annotations__ must be set to a dict object");
32589 0 : return -1;
32590 : }
32591 0 : Py_XINCREF(value);
32592 0 : __Pyx_Py_XDECREF_SET(op->func_annotations, value);
32593 0 : return 0;
32594 : }
32595 : static PyObject *
32596 0 : __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
32597 0 : PyObject* result = op->func_annotations;
32598 0 : CYTHON_UNUSED_VAR(context);
32599 0 : if (unlikely(!result)) {
32600 0 : result = PyDict_New();
32601 0 : if (unlikely(!result)) return NULL;
32602 0 : op->func_annotations = result;
32603 : }
32604 0 : Py_INCREF(result);
32605 : return result;
32606 : }
32607 : static PyObject *
32608 0 : __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
32609 0 : int is_coroutine;
32610 0 : CYTHON_UNUSED_VAR(context);
32611 0 : if (op->func_is_coroutine) {
32612 0 : return __Pyx_NewRef(op->func_is_coroutine);
32613 : }
32614 0 : is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
32615 : #if PY_VERSION_HEX >= 0x03050000
32616 0 : if (is_coroutine) {
32617 0 : PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine;
32618 0 : fromlist = PyList_New(1);
32619 0 : if (unlikely(!fromlist)) return NULL;
32620 0 : Py_INCREF(marker);
32621 : #if CYTHON_ASSUME_SAFE_MACROS
32622 0 : PyList_SET_ITEM(fromlist, 0, marker);
32623 : #else
32624 : if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
32625 : Py_DECREF(marker);
32626 : Py_DECREF(fromlist);
32627 : return NULL;
32628 : }
32629 : #endif
32630 0 : module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0);
32631 0 : Py_DECREF(fromlist);
32632 0 : if (unlikely(!module)) goto ignore;
32633 0 : op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker);
32634 0 : Py_DECREF(module);
32635 0 : if (likely(op->func_is_coroutine)) {
32636 0 : return __Pyx_NewRef(op->func_is_coroutine);
32637 : }
32638 0 : ignore:
32639 0 : PyErr_Clear();
32640 : }
32641 : #endif
32642 0 : op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine);
32643 0 : return __Pyx_NewRef(op->func_is_coroutine);
32644 : }
32645 : #if CYTHON_COMPILING_IN_LIMITED_API
32646 : static PyObject *
32647 : __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
32648 : CYTHON_UNUSED_VAR(context);
32649 : return PyObject_GetAttrString(op->func, "__module__");
32650 : }
32651 : static int
32652 : __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
32653 : CYTHON_UNUSED_VAR(context);
32654 : return PyObject_SetAttrString(op->func, "__module__", value);
32655 : }
32656 : #endif
32657 : static PyGetSetDef __pyx_CyFunction_getsets[] = {
32658 : {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
32659 : {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
32660 : {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
32661 : {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
32662 : {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
32663 : {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
32664 : {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
32665 : {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
32666 : {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
32667 : {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
32668 : {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
32669 : {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
32670 : {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
32671 : {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
32672 : {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
32673 : {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
32674 : {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
32675 : {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
32676 : #if CYTHON_COMPILING_IN_LIMITED_API
32677 : {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
32678 : #endif
32679 : {0, 0, 0, 0, 0}
32680 : };
32681 : static PyMemberDef __pyx_CyFunction_members[] = {
32682 : #if !CYTHON_COMPILING_IN_LIMITED_API
32683 : {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
32684 : #endif
32685 : #if CYTHON_USE_TYPE_SPECS
32686 : {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
32687 : #if CYTHON_METH_FASTCALL
32688 : #if CYTHON_BACKPORT_VECTORCALL
32689 : {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
32690 : #else
32691 : #if !CYTHON_COMPILING_IN_LIMITED_API
32692 : {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
32693 : #endif
32694 : #endif
32695 : #endif
32696 : #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
32697 : {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
32698 : #else
32699 : {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
32700 : #endif
32701 : #endif
32702 : {0, 0, 0, 0, 0}
32703 : };
32704 : static PyObject *
32705 0 : __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
32706 : {
32707 0 : CYTHON_UNUSED_VAR(args);
32708 : #if PY_MAJOR_VERSION >= 3
32709 0 : Py_INCREF(m->func_qualname);
32710 0 : return m->func_qualname;
32711 : #else
32712 : return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name);
32713 : #endif
32714 : }
32715 : static PyMethodDef __pyx_CyFunction_methods[] = {
32716 : {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
32717 : {0, 0, 0, 0}
32718 : };
32719 : #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
32720 : #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
32721 : #else
32722 : #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
32723 : #endif
32724 15 : static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
32725 : PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
32726 : #if !CYTHON_COMPILING_IN_LIMITED_API
32727 15 : PyCFunctionObject *cf = (PyCFunctionObject*) op;
32728 : #endif
32729 15 : if (unlikely(op == NULL))
32730 : return NULL;
32731 : #if CYTHON_COMPILING_IN_LIMITED_API
32732 : op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
32733 : if (unlikely(!op->func)) return NULL;
32734 : #endif
32735 15 : op->flags = flags;
32736 15 : __Pyx_CyFunction_weakreflist(op) = NULL;
32737 : #if !CYTHON_COMPILING_IN_LIMITED_API
32738 15 : cf->m_ml = ml;
32739 15 : cf->m_self = (PyObject *) op;
32740 : #endif
32741 15 : Py_XINCREF(closure);
32742 15 : op->func_closure = closure;
32743 : #if !CYTHON_COMPILING_IN_LIMITED_API
32744 15 : Py_XINCREF(module);
32745 15 : cf->m_module = module;
32746 : #endif
32747 15 : op->func_dict = NULL;
32748 15 : op->func_name = NULL;
32749 15 : Py_INCREF(qualname);
32750 15 : op->func_qualname = qualname;
32751 15 : op->func_doc = NULL;
32752 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
32753 : op->func_classobj = NULL;
32754 : #else
32755 15 : ((PyCMethodObject*)op)->mm_class = NULL;
32756 : #endif
32757 15 : op->func_globals = globals;
32758 15 : Py_INCREF(op->func_globals);
32759 15 : Py_XINCREF(code);
32760 15 : op->func_code = code;
32761 15 : op->defaults_pyobjects = 0;
32762 15 : op->defaults_size = 0;
32763 15 : op->defaults = NULL;
32764 15 : op->defaults_tuple = NULL;
32765 15 : op->defaults_kwdict = NULL;
32766 15 : op->defaults_getter = NULL;
32767 15 : op->func_annotations = NULL;
32768 15 : op->func_is_coroutine = NULL;
32769 : #if CYTHON_METH_FASTCALL
32770 15 : switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
32771 0 : case METH_NOARGS:
32772 0 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
32773 0 : break;
32774 0 : case METH_O:
32775 0 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
32776 0 : break;
32777 0 : case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
32778 0 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
32779 0 : break;
32780 6 : case METH_FASTCALL | METH_KEYWORDS:
32781 6 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
32782 6 : break;
32783 9 : case METH_VARARGS | METH_KEYWORDS:
32784 9 : __Pyx_CyFunction_func_vectorcall(op) = NULL;
32785 9 : break;
32786 0 : default:
32787 0 : PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
32788 0 : Py_DECREF(op);
32789 : return NULL;
32790 : }
32791 : #endif
32792 : return (PyObject *) op;
32793 : }
32794 : static int
32795 0 : __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
32796 : {
32797 0 : Py_CLEAR(m->func_closure);
32798 : #if CYTHON_COMPILING_IN_LIMITED_API
32799 : Py_CLEAR(m->func);
32800 : #else
32801 0 : Py_CLEAR(((PyCFunctionObject*)m)->m_module);
32802 : #endif
32803 0 : Py_CLEAR(m->func_dict);
32804 0 : Py_CLEAR(m->func_name);
32805 0 : Py_CLEAR(m->func_qualname);
32806 0 : Py_CLEAR(m->func_doc);
32807 0 : Py_CLEAR(m->func_globals);
32808 0 : Py_CLEAR(m->func_code);
32809 : #if !CYTHON_COMPILING_IN_LIMITED_API
32810 : #if PY_VERSION_HEX < 0x030900B1
32811 : Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
32812 : #else
32813 : {
32814 0 : PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
32815 0 : ((PyCMethodObject *) (m))->mm_class = NULL;
32816 0 : Py_XDECREF(cls);
32817 : }
32818 : #endif
32819 : #endif
32820 0 : Py_CLEAR(m->defaults_tuple);
32821 0 : Py_CLEAR(m->defaults_kwdict);
32822 0 : Py_CLEAR(m->func_annotations);
32823 0 : Py_CLEAR(m->func_is_coroutine);
32824 0 : if (m->defaults) {
32825 : PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
32826 : int i;
32827 0 : for (i = 0; i < m->defaults_pyobjects; i++)
32828 0 : Py_XDECREF(pydefaults[i]);
32829 0 : PyObject_Free(m->defaults);
32830 0 : m->defaults = NULL;
32831 : }
32832 0 : return 0;
32833 : }
32834 0 : static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
32835 : {
32836 0 : if (__Pyx_CyFunction_weakreflist(m) != NULL)
32837 0 : PyObject_ClearWeakRefs((PyObject *) m);
32838 0 : __Pyx_CyFunction_clear(m);
32839 0 : __Pyx_PyHeapTypeObject_GC_Del(m);
32840 0 : }
32841 0 : static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
32842 : {
32843 0 : PyObject_GC_UnTrack(m);
32844 0 : __Pyx__CyFunction_dealloc(m);
32845 0 : }
32846 0 : static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
32847 : {
32848 0 : Py_VISIT(m->func_closure);
32849 : #if CYTHON_COMPILING_IN_LIMITED_API
32850 : Py_VISIT(m->func);
32851 : #else
32852 0 : Py_VISIT(((PyCFunctionObject*)m)->m_module);
32853 : #endif
32854 0 : Py_VISIT(m->func_dict);
32855 0 : Py_VISIT(m->func_name);
32856 0 : Py_VISIT(m->func_qualname);
32857 0 : Py_VISIT(m->func_doc);
32858 0 : Py_VISIT(m->func_globals);
32859 0 : Py_VISIT(m->func_code);
32860 : #if !CYTHON_COMPILING_IN_LIMITED_API
32861 0 : Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
32862 : #endif
32863 0 : Py_VISIT(m->defaults_tuple);
32864 0 : Py_VISIT(m->defaults_kwdict);
32865 0 : Py_VISIT(m->func_is_coroutine);
32866 0 : if (m->defaults) {
32867 : PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
32868 : int i;
32869 0 : for (i = 0; i < m->defaults_pyobjects; i++)
32870 0 : Py_VISIT(pydefaults[i]);
32871 : }
32872 : return 0;
32873 : }
32874 : static PyObject*
32875 0 : __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
32876 : {
32877 : #if PY_MAJOR_VERSION >= 3
32878 0 : return PyUnicode_FromFormat("<cyfunction %U at %p>",
32879 : op->func_qualname, (void *)op);
32880 : #else
32881 : return PyString_FromFormat("<cyfunction %s at %p>",
32882 : PyString_AsString(op->func_qualname), (void *)op);
32883 : #endif
32884 : }
32885 0 : static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
32886 : #if CYTHON_COMPILING_IN_LIMITED_API
32887 : PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
32888 : PyObject *py_name = NULL;
32889 : PyCFunction meth;
32890 : int flags;
32891 : meth = PyCFunction_GetFunction(f);
32892 : if (unlikely(!meth)) return NULL;
32893 : flags = PyCFunction_GetFlags(f);
32894 : if (unlikely(flags < 0)) return NULL;
32895 : #else
32896 0 : PyCFunctionObject* f = (PyCFunctionObject*)func;
32897 0 : PyCFunction meth = f->m_ml->ml_meth;
32898 0 : int flags = f->m_ml->ml_flags;
32899 : #endif
32900 0 : Py_ssize_t size;
32901 0 : switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
32902 0 : case METH_VARARGS:
32903 0 : if (likely(kw == NULL || PyDict_Size(kw) == 0))
32904 0 : return (*meth)(self, arg);
32905 : break;
32906 0 : case METH_VARARGS | METH_KEYWORDS:
32907 0 : return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
32908 0 : case METH_NOARGS:
32909 0 : if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
32910 : #if CYTHON_ASSUME_SAFE_MACROS
32911 0 : size = PyTuple_GET_SIZE(arg);
32912 : #else
32913 : size = PyTuple_Size(arg);
32914 : if (unlikely(size < 0)) return NULL;
32915 : #endif
32916 0 : if (likely(size == 0))
32917 0 : return (*meth)(self, NULL);
32918 : #if CYTHON_COMPILING_IN_LIMITED_API
32919 : py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
32920 : if (!py_name) return NULL;
32921 : PyErr_Format(PyExc_TypeError,
32922 : "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
32923 : py_name, size);
32924 : Py_DECREF(py_name);
32925 : #else
32926 0 : PyErr_Format(PyExc_TypeError,
32927 : "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
32928 0 : f->m_ml->ml_name, size);
32929 : #endif
32930 0 : return NULL;
32931 : }
32932 : break;
32933 0 : case METH_O:
32934 0 : if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
32935 : #if CYTHON_ASSUME_SAFE_MACROS
32936 0 : size = PyTuple_GET_SIZE(arg);
32937 : #else
32938 : size = PyTuple_Size(arg);
32939 : if (unlikely(size < 0)) return NULL;
32940 : #endif
32941 0 : if (likely(size == 1)) {
32942 0 : PyObject *result, *arg0;
32943 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
32944 0 : arg0 = PyTuple_GET_ITEM(arg, 0);
32945 : #else
32946 : arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
32947 : #endif
32948 0 : result = (*meth)(self, arg0);
32949 : #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
32950 : Py_DECREF(arg0);
32951 : #endif
32952 0 : return result;
32953 : }
32954 : #if CYTHON_COMPILING_IN_LIMITED_API
32955 : py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
32956 : if (!py_name) return NULL;
32957 : PyErr_Format(PyExc_TypeError,
32958 : "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
32959 : py_name, size);
32960 : Py_DECREF(py_name);
32961 : #else
32962 0 : PyErr_Format(PyExc_TypeError,
32963 : "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
32964 0 : f->m_ml->ml_name, size);
32965 : #endif
32966 0 : return NULL;
32967 : }
32968 : break;
32969 0 : default:
32970 0 : PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
32971 0 : return NULL;
32972 : }
32973 : #if CYTHON_COMPILING_IN_LIMITED_API
32974 : py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
32975 : if (!py_name) return NULL;
32976 : PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments",
32977 : py_name);
32978 : Py_DECREF(py_name);
32979 : #else
32980 0 : PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
32981 0 : f->m_ml->ml_name);
32982 : #endif
32983 0 : return NULL;
32984 : }
32985 0 : static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
32986 0 : PyObject *self, *result;
32987 : #if CYTHON_COMPILING_IN_LIMITED_API
32988 : self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
32989 : if (unlikely(!self) && PyErr_Occurred()) return NULL;
32990 : #else
32991 0 : self = ((PyCFunctionObject*)func)->m_self;
32992 : #endif
32993 0 : result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
32994 0 : return result;
32995 : }
32996 0 : static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
32997 0 : PyObject *result;
32998 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
32999 : #if CYTHON_METH_FASTCALL
33000 0 : __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
33001 0 : if (vc) {
33002 : #if CYTHON_ASSUME_SAFE_MACROS
33003 0 : return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
33004 : #else
33005 : (void) &__Pyx_PyVectorcall_FastCallDict;
33006 : return PyVectorcall_Call(func, args, kw);
33007 : #endif
33008 : }
33009 : #endif
33010 0 : if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
33011 0 : Py_ssize_t argc;
33012 0 : PyObject *new_args;
33013 0 : PyObject *self;
33014 : #if CYTHON_ASSUME_SAFE_MACROS
33015 0 : argc = PyTuple_GET_SIZE(args);
33016 : #else
33017 : argc = PyTuple_Size(args);
33018 : if (unlikely(!argc) < 0) return NULL;
33019 : #endif
33020 0 : new_args = PyTuple_GetSlice(args, 1, argc);
33021 0 : if (unlikely(!new_args))
33022 : return NULL;
33023 0 : self = PyTuple_GetItem(args, 0);
33024 0 : if (unlikely(!self)) {
33025 0 : Py_DECREF(new_args);
33026 : #if PY_MAJOR_VERSION > 2
33027 0 : PyErr_Format(PyExc_TypeError,
33028 : "unbound method %.200S() needs an argument",
33029 : cyfunc->func_qualname);
33030 : #else
33031 : PyErr_SetString(PyExc_TypeError,
33032 : "unbound method needs an argument");
33033 : #endif
33034 0 : return NULL;
33035 : }
33036 0 : result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
33037 0 : Py_DECREF(new_args);
33038 : } else {
33039 0 : result = __Pyx_CyFunction_Call(func, args, kw);
33040 : }
33041 : return result;
33042 : }
33043 : #if CYTHON_METH_FASTCALL
33044 7 : static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
33045 : {
33046 7 : int ret = 0;
33047 7 : if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
33048 0 : if (unlikely(nargs < 1)) {
33049 0 : PyErr_Format(PyExc_TypeError, "%.200s() needs an argument",
33050 0 : ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
33051 0 : return -1;
33052 : }
33053 : ret = 1;
33054 : }
33055 7 : if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) {
33056 0 : PyErr_Format(PyExc_TypeError,
33057 0 : "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
33058 0 : return -1;
33059 : }
33060 : return ret;
33061 : }
33062 0 : static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
33063 : {
33064 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
33065 0 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
33066 : #if CYTHON_BACKPORT_VECTORCALL
33067 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
33068 : #else
33069 0 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
33070 : #endif
33071 0 : PyObject *self;
33072 0 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
33073 0 : case 1:
33074 0 : self = args[0];
33075 0 : args += 1;
33076 0 : nargs -= 1;
33077 0 : break;
33078 0 : case 0:
33079 0 : self = ((PyCFunctionObject*)cyfunc)->m_self;
33080 0 : break;
33081 : default:
33082 : return NULL;
33083 : }
33084 0 : if (unlikely(nargs != 0)) {
33085 0 : PyErr_Format(PyExc_TypeError,
33086 : "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
33087 : def->ml_name, nargs);
33088 0 : return NULL;
33089 : }
33090 0 : return def->ml_meth(self, NULL);
33091 : }
33092 0 : static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
33093 : {
33094 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
33095 0 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
33096 : #if CYTHON_BACKPORT_VECTORCALL
33097 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
33098 : #else
33099 0 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
33100 : #endif
33101 0 : PyObject *self;
33102 0 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
33103 0 : case 1:
33104 0 : self = args[0];
33105 0 : args += 1;
33106 0 : nargs -= 1;
33107 0 : break;
33108 0 : case 0:
33109 0 : self = ((PyCFunctionObject*)cyfunc)->m_self;
33110 0 : break;
33111 : default:
33112 : return NULL;
33113 : }
33114 0 : if (unlikely(nargs != 1)) {
33115 0 : PyErr_Format(PyExc_TypeError,
33116 : "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
33117 : def->ml_name, nargs);
33118 0 : return NULL;
33119 : }
33120 0 : return def->ml_meth(self, args[0]);
33121 : }
33122 7 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
33123 : {
33124 7 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
33125 7 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
33126 : #if CYTHON_BACKPORT_VECTORCALL
33127 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
33128 : #else
33129 7 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
33130 : #endif
33131 7 : PyObject *self;
33132 7 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
33133 0 : case 1:
33134 0 : self = args[0];
33135 0 : args += 1;
33136 0 : nargs -= 1;
33137 0 : break;
33138 7 : case 0:
33139 7 : self = ((PyCFunctionObject*)cyfunc)->m_self;
33140 7 : break;
33141 : default:
33142 : return NULL;
33143 : }
33144 7 : return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
33145 : }
33146 0 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
33147 : {
33148 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
33149 0 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
33150 0 : PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
33151 : #if CYTHON_BACKPORT_VECTORCALL
33152 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
33153 : #else
33154 0 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
33155 : #endif
33156 0 : PyObject *self;
33157 0 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
33158 0 : case 1:
33159 0 : self = args[0];
33160 0 : args += 1;
33161 0 : nargs -= 1;
33162 0 : break;
33163 0 : case 0:
33164 0 : self = ((PyCFunctionObject*)cyfunc)->m_self;
33165 0 : break;
33166 : default:
33167 : return NULL;
33168 : }
33169 0 : return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames);
33170 : }
33171 : #endif
33172 : #if CYTHON_USE_TYPE_SPECS
33173 : static PyType_Slot __pyx_CyFunctionType_slots[] = {
33174 : {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
33175 : {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
33176 : {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
33177 : {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
33178 : {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
33179 : {Py_tp_methods, (void *)__pyx_CyFunction_methods},
33180 : {Py_tp_members, (void *)__pyx_CyFunction_members},
33181 : {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
33182 : {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
33183 : {0, 0},
33184 : };
33185 : static PyType_Spec __pyx_CyFunctionType_spec = {
33186 : __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
33187 : sizeof(__pyx_CyFunctionObject),
33188 : 0,
33189 : #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
33190 : Py_TPFLAGS_METHOD_DESCRIPTOR |
33191 : #endif
33192 : #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL)
33193 : _Py_TPFLAGS_HAVE_VECTORCALL |
33194 : #endif
33195 : Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
33196 : __pyx_CyFunctionType_slots
33197 : };
33198 : #else
33199 : static PyTypeObject __pyx_CyFunctionType_type = {
33200 : PyVarObject_HEAD_INIT(0, 0)
33201 : __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
33202 : sizeof(__pyx_CyFunctionObject),
33203 : 0,
33204 : (destructor) __Pyx_CyFunction_dealloc,
33205 : #if !CYTHON_METH_FASTCALL
33206 : 0,
33207 : #elif CYTHON_BACKPORT_VECTORCALL
33208 : (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall),
33209 : #else
33210 : offsetof(PyCFunctionObject, vectorcall),
33211 : #endif
33212 : 0,
33213 : 0,
33214 : #if PY_MAJOR_VERSION < 3
33215 : 0,
33216 : #else
33217 : 0,
33218 : #endif
33219 : (reprfunc) __Pyx_CyFunction_repr,
33220 : 0,
33221 : 0,
33222 : 0,
33223 : 0,
33224 : __Pyx_CyFunction_CallAsMethod,
33225 : 0,
33226 : 0,
33227 : 0,
33228 : 0,
33229 : #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
33230 : Py_TPFLAGS_METHOD_DESCRIPTOR |
33231 : #endif
33232 : #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL
33233 : _Py_TPFLAGS_HAVE_VECTORCALL |
33234 : #endif
33235 : Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
33236 : 0,
33237 : (traverseproc) __Pyx_CyFunction_traverse,
33238 : (inquiry) __Pyx_CyFunction_clear,
33239 : 0,
33240 : #if PY_VERSION_HEX < 0x030500A0
33241 : offsetof(__pyx_CyFunctionObject, func_weakreflist),
33242 : #else
33243 : offsetof(PyCFunctionObject, m_weakreflist),
33244 : #endif
33245 : 0,
33246 : 0,
33247 : __pyx_CyFunction_methods,
33248 : __pyx_CyFunction_members,
33249 : __pyx_CyFunction_getsets,
33250 : 0,
33251 : 0,
33252 : __Pyx_PyMethod_New,
33253 : 0,
33254 : offsetof(__pyx_CyFunctionObject, func_dict),
33255 : 0,
33256 : 0,
33257 : 0,
33258 : 0,
33259 : 0,
33260 : 0,
33261 : 0,
33262 : 0,
33263 : 0,
33264 : 0,
33265 : 0,
33266 : 0,
33267 : #if PY_VERSION_HEX >= 0x030400a1
33268 : 0,
33269 : #endif
33270 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
33271 : 0,
33272 : #endif
33273 : #if __PYX_NEED_TP_PRINT_SLOT
33274 : 0,
33275 : #endif
33276 : #if PY_VERSION_HEX >= 0x030C0000
33277 : 0,
33278 : #endif
33279 : #if PY_VERSION_HEX >= 0x030d00A4
33280 : 0,
33281 : #endif
33282 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
33283 : 0,
33284 : #endif
33285 : };
33286 : #endif
33287 3 : static int __pyx_CyFunction_init(PyObject *module) {
33288 : #if CYTHON_USE_TYPE_SPECS
33289 : __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
33290 : #else
33291 3 : CYTHON_UNUSED_VAR(module);
33292 3 : __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
33293 : #endif
33294 3 : if (unlikely(__pyx_CyFunctionType == NULL)) {
33295 0 : return -1;
33296 : }
33297 : return 0;
33298 : }
33299 3 : static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
33300 3 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
33301 3 : m->defaults = PyObject_Malloc(size);
33302 3 : if (unlikely(!m->defaults))
33303 0 : return PyErr_NoMemory();
33304 3 : memset(m->defaults, 0, size);
33305 3 : m->defaults_pyobjects = pyobjects;
33306 3 : m->defaults_size = size;
33307 3 : return m->defaults;
33308 : }
33309 12 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
33310 12 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
33311 12 : m->defaults_tuple = tuple;
33312 15 : Py_INCREF(tuple);
33313 : }
33314 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
33315 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
33316 : m->defaults_kwdict = dict;
33317 : Py_INCREF(dict);
33318 : }
33319 : static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
33320 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
33321 : m->func_annotations = dict;
33322 : Py_INCREF(dict);
33323 : }
33324 :
33325 : /* CythonFunction */
33326 6 : static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
33327 : PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
33328 6 : PyObject *op = __Pyx_CyFunction_Init(
33329 6 : PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
33330 : ml, flags, qualname, closure, module, globals, code
33331 : );
33332 6 : if (likely(op)) {
33333 6 : PyObject_GC_Track(op);
33334 : }
33335 6 : return op;
33336 : }
33337 :
33338 : /* FusedFunction */
33339 : static PyObject *
33340 9 : __pyx_FusedFunction_New(PyMethodDef *ml, int flags,
33341 : PyObject *qualname, PyObject *closure,
33342 : PyObject *module, PyObject *globals,
33343 : PyObject *code)
33344 : {
33345 9 : PyObject *op = __Pyx_CyFunction_Init(
33346 9 : PyObject_GC_New(__pyx_CyFunctionObject, __pyx_FusedFunctionType),
33347 : ml, flags, qualname, closure, module, globals, code
33348 : );
33349 9 : if (likely(op)) {
33350 9 : __pyx_FusedFunctionObject *fusedfunc = (__pyx_FusedFunctionObject *) op;
33351 9 : fusedfunc->__signatures__ = NULL;
33352 9 : fusedfunc->self = NULL;
33353 9 : PyObject_GC_Track(op);
33354 : }
33355 9 : return op;
33356 : }
33357 : static void
33358 0 : __pyx_FusedFunction_dealloc(__pyx_FusedFunctionObject *self)
33359 : {
33360 0 : PyObject_GC_UnTrack(self);
33361 0 : Py_CLEAR(self->self);
33362 0 : Py_CLEAR(self->__signatures__);
33363 0 : __Pyx__CyFunction_dealloc((__pyx_CyFunctionObject *) self);
33364 0 : }
33365 : static int
33366 0 : __pyx_FusedFunction_traverse(__pyx_FusedFunctionObject *self,
33367 : visitproc visit,
33368 : void *arg)
33369 : {
33370 0 : Py_VISIT(self->self);
33371 0 : Py_VISIT(self->__signatures__);
33372 0 : return __Pyx_CyFunction_traverse((__pyx_CyFunctionObject *) self, visit, arg);
33373 : }
33374 : static int
33375 0 : __pyx_FusedFunction_clear(__pyx_FusedFunctionObject *self)
33376 : {
33377 0 : Py_CLEAR(self->self);
33378 0 : Py_CLEAR(self->__signatures__);
33379 0 : return __Pyx_CyFunction_clear((__pyx_CyFunctionObject *) self);
33380 : }
33381 : static PyObject *
33382 0 : __pyx_FusedFunction_descr_get(PyObject *self, PyObject *obj, PyObject *type)
33383 : {
33384 0 : __pyx_FusedFunctionObject *func, *meth;
33385 0 : func = (__pyx_FusedFunctionObject *) self;
33386 0 : if (func->self || func->func.flags & __Pyx_CYFUNCTION_STATICMETHOD) {
33387 0 : Py_INCREF(self);
33388 0 : return self;
33389 : }
33390 0 : if (obj == Py_None)
33391 0 : obj = NULL;
33392 0 : if (func->func.flags & __Pyx_CYFUNCTION_CLASSMETHOD)
33393 0 : obj = type;
33394 0 : if (obj == NULL) {
33395 0 : Py_INCREF(self);
33396 0 : return self;
33397 : }
33398 0 : meth = (__pyx_FusedFunctionObject *) __pyx_FusedFunction_New(
33399 : ((PyCFunctionObject *) func)->m_ml,
33400 : ((__pyx_CyFunctionObject *) func)->flags,
33401 : ((__pyx_CyFunctionObject *) func)->func_qualname,
33402 : ((__pyx_CyFunctionObject *) func)->func_closure,
33403 : ((PyCFunctionObject *) func)->m_module,
33404 : ((__pyx_CyFunctionObject *) func)->func_globals,
33405 : ((__pyx_CyFunctionObject *) func)->func_code);
33406 0 : if (unlikely(!meth))
33407 : return NULL;
33408 0 : if (func->func.defaults) {
33409 0 : PyObject **pydefaults;
33410 0 : int i;
33411 0 : if (unlikely(!__Pyx_CyFunction_InitDefaults(
33412 : (PyObject*)meth,
33413 : func->func.defaults_size,
33414 : func->func.defaults_pyobjects))) {
33415 0 : Py_XDECREF((PyObject*)meth);
33416 0 : return NULL;
33417 : }
33418 0 : memcpy(meth->func.defaults, func->func.defaults, func->func.defaults_size);
33419 0 : pydefaults = __Pyx_CyFunction_Defaults(PyObject *, meth);
33420 0 : for (i = 0; i < meth->func.defaults_pyobjects; i++)
33421 0 : Py_XINCREF(pydefaults[i]);
33422 : }
33423 0 : __Pyx_CyFunction_SetClassObj(meth, __Pyx_CyFunction_GetClassObj(func));
33424 0 : Py_XINCREF(func->__signatures__);
33425 0 : meth->__signatures__ = func->__signatures__;
33426 0 : Py_XINCREF(func->func.defaults_tuple);
33427 0 : meth->func.defaults_tuple = func->func.defaults_tuple;
33428 0 : Py_XINCREF(obj);
33429 0 : meth->self = obj;
33430 0 : return (PyObject *) meth;
33431 : }
33432 : static PyObject *
33433 0 : _obj_to_string(PyObject *obj)
33434 : {
33435 0 : if (PyUnicode_CheckExact(obj))
33436 0 : return __Pyx_NewRef(obj);
33437 : #if PY_MAJOR_VERSION == 2
33438 : else if (PyString_Check(obj))
33439 : return PyUnicode_FromEncodedObject(obj, NULL, "strict");
33440 : #endif
33441 0 : else if (PyType_Check(obj))
33442 0 : return PyObject_GetAttr(obj, __pyx_n_s_name_2);
33443 : else
33444 0 : return PyObject_Unicode(obj);
33445 : }
33446 : static PyObject *
33447 0 : __pyx_FusedFunction_getitem(__pyx_FusedFunctionObject *self, PyObject *idx)
33448 : {
33449 0 : PyObject *signature = NULL;
33450 0 : PyObject *unbound_result_func;
33451 0 : PyObject *result_func = NULL;
33452 0 : if (unlikely(self->__signatures__ == NULL)) {
33453 0 : PyErr_SetString(PyExc_TypeError, "Function is not fused");
33454 0 : return NULL;
33455 : }
33456 0 : if (PyTuple_Check(idx)) {
33457 0 : Py_ssize_t n = PyTuple_GET_SIZE(idx);
33458 0 : PyObject *list = PyList_New(n);
33459 0 : int i;
33460 0 : if (unlikely(!list))
33461 : return NULL;
33462 0 : for (i = 0; i < n; i++) {
33463 0 : PyObject *string;
33464 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33465 0 : PyObject *item = PyTuple_GET_ITEM(idx, i);
33466 : #else
33467 : PyObject *item = PySequence_ITEM(idx, i); if (unlikely(!item)) goto __pyx_err;
33468 : #endif
33469 0 : string = _obj_to_string(item);
33470 : #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
33471 : Py_DECREF(item);
33472 : #endif
33473 0 : if (unlikely(!string)) goto __pyx_err;
33474 0 : PyList_SET_ITEM(list, i, string);
33475 : }
33476 0 : signature = PyUnicode_Join(__pyx_kp_u__14, list);
33477 0 : __pyx_err:;
33478 0 : Py_DECREF(list);
33479 : } else {
33480 0 : signature = _obj_to_string(idx);
33481 : }
33482 0 : if (unlikely(!signature))
33483 : return NULL;
33484 0 : unbound_result_func = PyObject_GetItem(self->__signatures__, signature);
33485 0 : if (likely(unbound_result_func)) {
33486 0 : if (self->self) {
33487 0 : __pyx_FusedFunctionObject *unbound = (__pyx_FusedFunctionObject *) unbound_result_func;
33488 0 : __Pyx_CyFunction_SetClassObj(unbound, __Pyx_CyFunction_GetClassObj(self));
33489 0 : result_func = __pyx_FusedFunction_descr_get(unbound_result_func,
33490 : self->self, self->self);
33491 : } else {
33492 0 : result_func = unbound_result_func;
33493 0 : Py_INCREF(result_func);
33494 : }
33495 : }
33496 0 : Py_DECREF(signature);
33497 0 : Py_XDECREF(unbound_result_func);
33498 0 : return result_func;
33499 : }
33500 : static PyObject *
33501 0 : __pyx_FusedFunction_callfunction(PyObject *func, PyObject *args, PyObject *kw)
33502 : {
33503 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
33504 0 : int static_specialized = (cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD &&
33505 0 : !((__pyx_FusedFunctionObject *) func)->__signatures__);
33506 0 : if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !static_specialized) {
33507 0 : return __Pyx_CyFunction_CallAsMethod(func, args, kw);
33508 : } else {
33509 0 : return __Pyx_CyFunction_Call(func, args, kw);
33510 : }
33511 : }
33512 : static PyObject *
33513 0 : __pyx_FusedFunction_call(PyObject *func, PyObject *args, PyObject *kw)
33514 : {
33515 0 : __pyx_FusedFunctionObject *binding_func = (__pyx_FusedFunctionObject *) func;
33516 0 : Py_ssize_t argc = PyTuple_GET_SIZE(args);
33517 0 : PyObject *new_args = NULL;
33518 0 : __pyx_FusedFunctionObject *new_func = NULL;
33519 0 : PyObject *result = NULL;
33520 0 : int is_staticmethod = binding_func->func.flags & __Pyx_CYFUNCTION_STATICMETHOD;
33521 0 : if (binding_func->self) {
33522 0 : PyObject *self;
33523 0 : Py_ssize_t i;
33524 0 : new_args = PyTuple_New(argc + 1);
33525 0 : if (unlikely(!new_args))
33526 : return NULL;
33527 0 : self = binding_func->self;
33528 0 : Py_INCREF(self);
33529 0 : PyTuple_SET_ITEM(new_args, 0, self);
33530 0 : self = NULL;
33531 0 : for (i = 0; i < argc; i++) {
33532 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33533 0 : PyObject *item = PyTuple_GET_ITEM(args, i);
33534 0 : Py_INCREF(item);
33535 : #else
33536 : PyObject *item = PySequence_ITEM(args, i); if (unlikely(!item)) goto bad;
33537 : #endif
33538 0 : PyTuple_SET_ITEM(new_args, i + 1, item);
33539 : }
33540 : args = new_args;
33541 : }
33542 0 : if (binding_func->__signatures__) {
33543 0 : PyObject *tup;
33544 0 : if (is_staticmethod && binding_func->func.flags & __Pyx_CYFUNCTION_CCLASS) {
33545 0 : tup = PyTuple_Pack(3, args,
33546 : kw == NULL ? Py_None : kw,
33547 : binding_func->func.defaults_tuple);
33548 0 : if (unlikely(!tup)) goto bad;
33549 0 : new_func = (__pyx_FusedFunctionObject *) __Pyx_CyFunction_CallMethod(
33550 : func, binding_func->__signatures__, tup, NULL);
33551 : } else {
33552 0 : tup = PyTuple_Pack(4, binding_func->__signatures__, args,
33553 : kw == NULL ? Py_None : kw,
33554 : binding_func->func.defaults_tuple);
33555 0 : if (unlikely(!tup)) goto bad;
33556 0 : new_func = (__pyx_FusedFunctionObject *) __pyx_FusedFunction_callfunction(func, tup, NULL);
33557 : }
33558 0 : Py_DECREF(tup);
33559 0 : if (unlikely(!new_func))
33560 0 : goto bad;
33561 0 : __Pyx_CyFunction_SetClassObj(new_func, __Pyx_CyFunction_GetClassObj(binding_func));
33562 0 : func = (PyObject *) new_func;
33563 : }
33564 0 : result = __pyx_FusedFunction_callfunction(func, args, kw);
33565 0 : bad:
33566 0 : Py_XDECREF(new_args);
33567 0 : Py_XDECREF((PyObject *) new_func);
33568 0 : return result;
33569 : }
33570 : static PyMemberDef __pyx_FusedFunction_members[] = {
33571 : {(char *) "__signatures__",
33572 : T_OBJECT,
33573 : offsetof(__pyx_FusedFunctionObject, __signatures__),
33574 : READONLY,
33575 : 0},
33576 : {(char *) "__self__", T_OBJECT_EX, offsetof(__pyx_FusedFunctionObject, self), READONLY, 0},
33577 : {0, 0, 0, 0, 0},
33578 : };
33579 : static PyGetSetDef __pyx_FusedFunction_getsets[] = {
33580 : {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
33581 : {0, 0, 0, 0, 0}
33582 : };
33583 : #if CYTHON_USE_TYPE_SPECS
33584 : static PyType_Slot __pyx_FusedFunctionType_slots[] = {
33585 : {Py_tp_dealloc, (void *)__pyx_FusedFunction_dealloc},
33586 : {Py_tp_call, (void *)__pyx_FusedFunction_call},
33587 : {Py_tp_traverse, (void *)__pyx_FusedFunction_traverse},
33588 : {Py_tp_clear, (void *)__pyx_FusedFunction_clear},
33589 : {Py_tp_members, (void *)__pyx_FusedFunction_members},
33590 : {Py_tp_getset, (void *)__pyx_FusedFunction_getsets},
33591 : {Py_tp_descr_get, (void *)__pyx_FusedFunction_descr_get},
33592 : {Py_mp_subscript, (void *)__pyx_FusedFunction_getitem},
33593 : {0, 0},
33594 : };
33595 : static PyType_Spec __pyx_FusedFunctionType_spec = {
33596 : __PYX_TYPE_MODULE_PREFIX "fused_cython_function",
33597 : sizeof(__pyx_FusedFunctionObject),
33598 : 0,
33599 : Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
33600 : __pyx_FusedFunctionType_slots
33601 : };
33602 : #else
33603 : static PyMappingMethods __pyx_FusedFunction_mapping_methods = {
33604 : 0,
33605 : (binaryfunc) __pyx_FusedFunction_getitem,
33606 : 0,
33607 : };
33608 : static PyTypeObject __pyx_FusedFunctionType_type = {
33609 : PyVarObject_HEAD_INIT(0, 0)
33610 : __PYX_TYPE_MODULE_PREFIX "fused_cython_function",
33611 : sizeof(__pyx_FusedFunctionObject),
33612 : 0,
33613 : (destructor) __pyx_FusedFunction_dealloc,
33614 : 0,
33615 : 0,
33616 : 0,
33617 : #if PY_MAJOR_VERSION < 3
33618 : 0,
33619 : #else
33620 : 0,
33621 : #endif
33622 : 0,
33623 : 0,
33624 : 0,
33625 : &__pyx_FusedFunction_mapping_methods,
33626 : 0,
33627 : (ternaryfunc) __pyx_FusedFunction_call,
33628 : 0,
33629 : 0,
33630 : 0,
33631 : 0,
33632 : Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
33633 : 0,
33634 : (traverseproc) __pyx_FusedFunction_traverse,
33635 : (inquiry) __pyx_FusedFunction_clear,
33636 : 0,
33637 : 0,
33638 : 0,
33639 : 0,
33640 : 0,
33641 : __pyx_FusedFunction_members,
33642 : __pyx_FusedFunction_getsets,
33643 : &__pyx_CyFunctionType_type,
33644 : 0,
33645 : __pyx_FusedFunction_descr_get,
33646 : 0,
33647 : 0,
33648 : 0,
33649 : 0,
33650 : 0,
33651 : 0,
33652 : 0,
33653 : 0,
33654 : 0,
33655 : 0,
33656 : 0,
33657 : 0,
33658 : 0,
33659 : 0,
33660 : #if PY_VERSION_HEX >= 0x030400a1
33661 : 0,
33662 : #endif
33663 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
33664 : 0,
33665 : #endif
33666 : #if __PYX_NEED_TP_PRINT_SLOT
33667 : 0,
33668 : #endif
33669 : #if PY_VERSION_HEX >= 0x030C0000
33670 : 0,
33671 : #endif
33672 : #if PY_VERSION_HEX >= 0x030d00A4
33673 : 0,
33674 : #endif
33675 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
33676 : 0,
33677 : #endif
33678 : };
33679 : #endif
33680 3 : static int __pyx_FusedFunction_init(PyObject *module) {
33681 : #if CYTHON_USE_TYPE_SPECS
33682 : PyObject *bases = PyTuple_Pack(1, __pyx_CyFunctionType);
33683 : if (unlikely(!bases)) {
33684 : return -1;
33685 : }
33686 : __pyx_FusedFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_FusedFunctionType_spec, bases);
33687 : Py_DECREF(bases);
33688 : #else
33689 3 : CYTHON_UNUSED_VAR(module);
33690 3 : __pyx_FusedFunctionType_type.tp_base = __pyx_CyFunctionType;
33691 3 : __pyx_FusedFunctionType = __Pyx_FetchCommonType(&__pyx_FusedFunctionType_type);
33692 : #endif
33693 3 : if (unlikely(__pyx_FusedFunctionType == NULL)) {
33694 0 : return -1;
33695 : }
33696 : return 0;
33697 : }
33698 :
33699 : /* CLineInTraceback */
33700 : #ifndef CYTHON_CLINE_IN_TRACEBACK
33701 0 : static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
33702 0 : PyObject *use_cline;
33703 0 : PyObject *ptype, *pvalue, *ptraceback;
33704 : #if CYTHON_COMPILING_IN_CPYTHON
33705 0 : PyObject **cython_runtime_dict;
33706 : #endif
33707 0 : CYTHON_MAYBE_UNUSED_VAR(tstate);
33708 0 : if (unlikely(!__pyx_cython_runtime)) {
33709 : return c_line;
33710 : }
33711 0 : __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
33712 : #if CYTHON_COMPILING_IN_CPYTHON
33713 0 : cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
33714 0 : if (likely(cython_runtime_dict)) {
33715 0 : __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
33716 : use_cline, *cython_runtime_dict,
33717 : __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
33718 : } else
33719 : #endif
33720 : {
33721 0 : PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
33722 0 : if (use_cline_obj) {
33723 0 : use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
33724 0 : Py_DECREF(use_cline_obj);
33725 : } else {
33726 0 : PyErr_Clear();
33727 0 : use_cline = NULL;
33728 : }
33729 : }
33730 0 : if (!use_cline) {
33731 0 : c_line = 0;
33732 0 : (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
33733 : }
33734 0 : else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
33735 : c_line = 0;
33736 : }
33737 0 : __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
33738 0 : return c_line;
33739 : }
33740 : #endif
33741 :
33742 : /* CodeObjectCache */
33743 : #if !CYTHON_COMPILING_IN_LIMITED_API
33744 0 : static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
33745 0 : int start = 0, mid = 0, end = count - 1;
33746 0 : if (end >= 0 && code_line > entries[end].code_line) {
33747 : return count;
33748 : }
33749 0 : while (start < end) {
33750 0 : mid = start + (end - start) / 2;
33751 0 : if (code_line < entries[mid].code_line) {
33752 : end = mid;
33753 0 : } else if (code_line > entries[mid].code_line) {
33754 0 : start = mid + 1;
33755 : } else {
33756 0 : return mid;
33757 : }
33758 : }
33759 0 : if (code_line <= entries[mid].code_line) {
33760 : return mid;
33761 : } else {
33762 0 : return mid + 1;
33763 : }
33764 : }
33765 0 : static PyCodeObject *__pyx_find_code_object(int code_line) {
33766 0 : PyCodeObject* code_object;
33767 0 : int pos;
33768 0 : if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
33769 : return NULL;
33770 : }
33771 0 : pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
33772 0 : if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
33773 : return NULL;
33774 : }
33775 0 : code_object = __pyx_code_cache.entries[pos].code_object;
33776 0 : Py_INCREF(code_object);
33777 : return code_object;
33778 : }
33779 0 : static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
33780 0 : int pos, i;
33781 0 : __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
33782 0 : if (unlikely(!code_line)) {
33783 : return;
33784 : }
33785 0 : if (unlikely(!entries)) {
33786 0 : entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
33787 0 : if (likely(entries)) {
33788 0 : __pyx_code_cache.entries = entries;
33789 0 : __pyx_code_cache.max_count = 64;
33790 0 : __pyx_code_cache.count = 1;
33791 0 : entries[0].code_line = code_line;
33792 0 : entries[0].code_object = code_object;
33793 0 : Py_INCREF(code_object);
33794 : }
33795 0 : return;
33796 : }
33797 0 : pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
33798 0 : if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
33799 0 : PyCodeObject* tmp = entries[pos].code_object;
33800 0 : entries[pos].code_object = code_object;
33801 0 : Py_DECREF(tmp);
33802 0 : return;
33803 : }
33804 0 : if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
33805 0 : int new_max = __pyx_code_cache.max_count + 64;
33806 0 : entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
33807 0 : __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
33808 0 : if (unlikely(!entries)) {
33809 : return;
33810 : }
33811 0 : __pyx_code_cache.entries = entries;
33812 0 : __pyx_code_cache.max_count = new_max;
33813 : }
33814 0 : for (i=__pyx_code_cache.count; i>pos; i--) {
33815 0 : entries[i] = entries[i-1];
33816 : }
33817 0 : entries[pos].code_line = code_line;
33818 0 : entries[pos].code_object = code_object;
33819 0 : __pyx_code_cache.count++;
33820 0 : Py_INCREF(code_object);
33821 : }
33822 : #endif
33823 :
33824 : /* AddTraceback */
33825 : #include "compile.h"
33826 : #include "frameobject.h"
33827 : #include "traceback.h"
33828 : #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
33829 : #ifndef Py_BUILD_CORE
33830 : #define Py_BUILD_CORE 1
33831 : #endif
33832 : #include "internal/pycore_frame.h"
33833 : #endif
33834 : #if CYTHON_COMPILING_IN_LIMITED_API
33835 : static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
33836 : PyObject *firstlineno, PyObject *name) {
33837 : PyObject *replace = NULL;
33838 : if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
33839 : if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
33840 : replace = PyObject_GetAttrString(code, "replace");
33841 : if (likely(replace)) {
33842 : PyObject *result;
33843 : result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict);
33844 : Py_DECREF(replace);
33845 : return result;
33846 : }
33847 : PyErr_Clear();
33848 : #if __PYX_LIMITED_VERSION_HEX < 0x030780000
33849 : {
33850 : PyObject *compiled = NULL, *result = NULL;
33851 : if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
33852 : if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL;
33853 : compiled = Py_CompileString(
33854 : "out = type(code)(\n"
33855 : " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n"
33856 : " code.co_flags, code.co_code, code.co_consts, code.co_names,\n"
33857 : " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n"
33858 : " code.co_lnotab)\n", "<dummy>", Py_file_input);
33859 : if (!compiled) return NULL;
33860 : result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict);
33861 : Py_DECREF(compiled);
33862 : if (!result) PyErr_Print();
33863 : Py_DECREF(result);
33864 : result = PyDict_GetItemString(scratch_dict, "out");
33865 : if (result) Py_INCREF(result);
33866 : return result;
33867 : }
33868 : #else
33869 : return NULL;
33870 : #endif
33871 : }
33872 : static void __Pyx_AddTraceback(const char *funcname, int c_line,
33873 : int py_line, const char *filename) {
33874 : PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
33875 : PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
33876 : PyObject *exc_type, *exc_value, *exc_traceback;
33877 : int success = 0;
33878 : if (c_line) {
33879 : (void) __pyx_cfilenm;
33880 : (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
33881 : }
33882 : PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
33883 : code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
33884 : if (unlikely(!code_object)) goto bad;
33885 : py_py_line = PyLong_FromLong(py_line);
33886 : if (unlikely(!py_py_line)) goto bad;
33887 : py_funcname = PyUnicode_FromString(funcname);
33888 : if (unlikely(!py_funcname)) goto bad;
33889 : dict = PyDict_New();
33890 : if (unlikely(!dict)) goto bad;
33891 : {
33892 : PyObject *old_code_object = code_object;
33893 : code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
33894 : Py_DECREF(old_code_object);
33895 : }
33896 : if (unlikely(!code_object)) goto bad;
33897 : getframe = PySys_GetObject("_getframe");
33898 : if (unlikely(!getframe)) goto bad;
33899 : if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
33900 : frame = PyEval_EvalCode(code_object, dict, dict);
33901 : if (unlikely(!frame) || frame == Py_None) goto bad;
33902 : success = 1;
33903 : bad:
33904 : PyErr_Restore(exc_type, exc_value, exc_traceback);
33905 : Py_XDECREF(code_object);
33906 : Py_XDECREF(py_py_line);
33907 : Py_XDECREF(py_funcname);
33908 : Py_XDECREF(dict);
33909 : Py_XDECREF(replace);
33910 : if (success) {
33911 : PyTraceBack_Here(
33912 : (struct _frame*)frame);
33913 : }
33914 : Py_XDECREF(frame);
33915 : }
33916 : #else
33917 0 : static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
33918 : const char *funcname, int c_line,
33919 : int py_line, const char *filename) {
33920 0 : PyCodeObject *py_code = NULL;
33921 0 : PyObject *py_funcname = NULL;
33922 : #if PY_MAJOR_VERSION < 3
33923 : PyObject *py_srcfile = NULL;
33924 : py_srcfile = PyString_FromString(filename);
33925 : if (!py_srcfile) goto bad;
33926 : #endif
33927 0 : if (c_line) {
33928 : #if PY_MAJOR_VERSION < 3
33929 : py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
33930 : if (!py_funcname) goto bad;
33931 : #else
33932 0 : py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
33933 0 : if (!py_funcname) goto bad;
33934 0 : funcname = PyUnicode_AsUTF8(py_funcname);
33935 0 : if (!funcname) goto bad;
33936 : #endif
33937 : }
33938 : else {
33939 : #if PY_MAJOR_VERSION < 3
33940 : py_funcname = PyString_FromString(funcname);
33941 : if (!py_funcname) goto bad;
33942 : #endif
33943 0 : }
33944 : #if PY_MAJOR_VERSION < 3
33945 : py_code = __Pyx_PyCode_New(
33946 : 0,
33947 : 0,
33948 : 0,
33949 : 0,
33950 : 0,
33951 : 0,
33952 : __pyx_empty_bytes, /*PyObject *code,*/
33953 : __pyx_empty_tuple, /*PyObject *consts,*/
33954 : __pyx_empty_tuple, /*PyObject *names,*/
33955 : __pyx_empty_tuple, /*PyObject *varnames,*/
33956 : __pyx_empty_tuple, /*PyObject *freevars,*/
33957 : __pyx_empty_tuple, /*PyObject *cellvars,*/
33958 : py_srcfile, /*PyObject *filename,*/
33959 : py_funcname, /*PyObject *name,*/
33960 : py_line,
33961 : __pyx_empty_bytes /*PyObject *lnotab*/
33962 : );
33963 : Py_DECREF(py_srcfile);
33964 : #else
33965 0 : py_code = PyCode_NewEmpty(filename, funcname, py_line);
33966 : #endif
33967 0 : Py_XDECREF(py_funcname);
33968 0 : return py_code;
33969 0 : bad:
33970 0 : Py_XDECREF(py_funcname);
33971 : #if PY_MAJOR_VERSION < 3
33972 : Py_XDECREF(py_srcfile);
33973 : #endif
33974 0 : return NULL;
33975 : }
33976 0 : static void __Pyx_AddTraceback(const char *funcname, int c_line,
33977 : int py_line, const char *filename) {
33978 0 : PyCodeObject *py_code = 0;
33979 0 : PyFrameObject *py_frame = 0;
33980 0 : PyThreadState *tstate = __Pyx_PyThreadState_Current;
33981 0 : PyObject *ptype, *pvalue, *ptraceback;
33982 0 : if (c_line) {
33983 0 : c_line = __Pyx_CLineForTraceback(tstate, c_line);
33984 : }
33985 0 : py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
33986 0 : if (!py_code) {
33987 0 : __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
33988 0 : py_code = __Pyx_CreateCodeObjectForTraceback(
33989 : funcname, c_line, py_line, filename);
33990 0 : if (!py_code) {
33991 : /* If the code object creation fails, then we should clear the
33992 : fetched exception references and propagate the new exception */
33993 0 : Py_XDECREF(ptype);
33994 0 : Py_XDECREF(pvalue);
33995 0 : Py_XDECREF(ptraceback);
33996 0 : goto bad;
33997 : }
33998 0 : __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
33999 0 : __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
34000 : }
34001 0 : py_frame = PyFrame_New(
34002 : tstate, /*PyThreadState *tstate,*/
34003 : py_code, /*PyCodeObject *code,*/
34004 0 : __pyx_d, /*PyObject *globals,*/
34005 : 0 /*PyObject *locals*/
34006 : );
34007 0 : if (!py_frame) goto bad;
34008 0 : __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
34009 0 : PyTraceBack_Here(py_frame);
34010 0 : bad:
34011 0 : Py_XDECREF(py_code);
34012 0 : Py_XDECREF(py_frame);
34013 0 : }
34014 : #endif
34015 :
34016 : #if PY_MAJOR_VERSION < 3
34017 : static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
34018 : __Pyx_TypeName obj_type_name;
34019 : if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
34020 : if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
34021 : if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
34022 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
34023 : PyErr_Format(PyExc_TypeError,
34024 : "'" __Pyx_FMT_TYPENAME "' does not have the buffer interface",
34025 : obj_type_name);
34026 : __Pyx_DECREF_TypeName(obj_type_name);
34027 : return -1;
34028 : }
34029 : static void __Pyx_ReleaseBuffer(Py_buffer *view) {
34030 : PyObject *obj = view->obj;
34031 : if (!obj) return;
34032 : if (PyObject_CheckBuffer(obj)) {
34033 : PyBuffer_Release(view);
34034 : return;
34035 : }
34036 : if ((0)) {}
34037 : view->obj = NULL;
34038 : Py_DECREF(obj);
34039 : }
34040 : #endif
34041 :
34042 :
34043 : /* MemviewSliceIsContig */
34044 : static int
34045 0 : __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
34046 : {
34047 0 : int i, index, step, start;
34048 0 : Py_ssize_t itemsize = mvs.memview->view.itemsize;
34049 0 : if (order == 'F') {
34050 : step = 1;
34051 : start = 0;
34052 : } else {
34053 0 : step = -1;
34054 0 : start = ndim - 1;
34055 : }
34056 0 : for (i = 0; i < ndim; i++) {
34057 0 : index = start + step * i;
34058 0 : if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
34059 : return 0;
34060 0 : itemsize *= mvs.shape[index];
34061 : }
34062 : return 1;
34063 : }
34064 :
34065 : /* OverlappingSlices */
34066 : static void
34067 0 : __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
34068 : void **out_start, void **out_end,
34069 : int ndim, size_t itemsize)
34070 : {
34071 0 : char *start, *end;
34072 0 : int i;
34073 0 : start = end = slice->data;
34074 0 : for (i = 0; i < ndim; i++) {
34075 0 : Py_ssize_t stride = slice->strides[i];
34076 0 : Py_ssize_t extent = slice->shape[i];
34077 0 : if (extent == 0) {
34078 0 : *out_start = *out_end = start;
34079 0 : return;
34080 : } else {
34081 0 : if (stride > 0)
34082 0 : end += stride * (extent - 1);
34083 : else
34084 0 : start += stride * (extent - 1);
34085 : }
34086 : }
34087 0 : *out_start = start;
34088 0 : *out_end = end + itemsize;
34089 : }
34090 : static int
34091 0 : __pyx_slices_overlap(__Pyx_memviewslice *slice1,
34092 : __Pyx_memviewslice *slice2,
34093 : int ndim, size_t itemsize)
34094 : {
34095 0 : void *start1, *end1, *start2, *end2;
34096 0 : __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
34097 0 : __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
34098 0 : return (start1 < end2) && (start2 < end1);
34099 : }
34100 :
34101 : /* TypeInfoCompare */
34102 : static int
34103 0 : __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
34104 : {
34105 0 : int i;
34106 0 : if (!a || !b)
34107 : return 0;
34108 0 : if (a == b)
34109 : return 1;
34110 0 : if (a->size != b->size || a->typegroup != b->typegroup ||
34111 0 : a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
34112 0 : if (a->typegroup == 'H' || b->typegroup == 'H') {
34113 0 : return a->size == b->size;
34114 : } else {
34115 : return 0;
34116 : }
34117 : }
34118 0 : if (a->ndim) {
34119 0 : for (i = 0; i < a->ndim; i++)
34120 0 : if (a->arraysize[i] != b->arraysize[i])
34121 : return 0;
34122 : }
34123 0 : if (a->typegroup == 'S') {
34124 0 : if (a->flags != b->flags)
34125 : return 0;
34126 0 : if (a->fields || b->fields) {
34127 0 : if (!(a->fields && b->fields))
34128 : return 0;
34129 0 : for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
34130 0 : __Pyx_StructField *field_a = a->fields + i;
34131 0 : __Pyx_StructField *field_b = b->fields + i;
34132 0 : if (field_a->offset != field_b->offset ||
34133 0 : !__pyx_typeinfo_cmp(field_a->type, field_b->type))
34134 0 : return 0;
34135 : }
34136 0 : return !a->fields[i].type && !b->fields[i].type;
34137 : }
34138 : }
34139 : return 1;
34140 : }
34141 :
34142 : /* MemviewSliceValidateAndInit */
34143 : static int
34144 0 : __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
34145 : {
34146 0 : if (buf->shape[dim] <= 1)
34147 : return 1;
34148 0 : if (buf->strides) {
34149 0 : if (spec & __Pyx_MEMVIEW_CONTIG) {
34150 0 : if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
34151 0 : if (unlikely(buf->strides[dim] != sizeof(void *))) {
34152 0 : PyErr_Format(PyExc_ValueError,
34153 : "Buffer is not indirectly contiguous "
34154 : "in dimension %d.", dim);
34155 0 : goto fail;
34156 : }
34157 0 : } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
34158 0 : PyErr_SetString(PyExc_ValueError,
34159 : "Buffer and memoryview are not contiguous "
34160 : "in the same dimension.");
34161 0 : goto fail;
34162 : }
34163 : }
34164 0 : if (spec & __Pyx_MEMVIEW_FOLLOW) {
34165 0 : Py_ssize_t stride = buf->strides[dim];
34166 0 : if (stride < 0)
34167 : stride = -stride;
34168 0 : if (unlikely(stride < buf->itemsize)) {
34169 0 : PyErr_SetString(PyExc_ValueError,
34170 : "Buffer and memoryview are not contiguous "
34171 : "in the same dimension.");
34172 0 : goto fail;
34173 : }
34174 : }
34175 : } else {
34176 0 : if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
34177 0 : PyErr_Format(PyExc_ValueError,
34178 : "C-contiguous buffer is not contiguous in "
34179 : "dimension %d", dim);
34180 0 : goto fail;
34181 0 : } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
34182 0 : PyErr_Format(PyExc_ValueError,
34183 : "C-contiguous buffer is not indirect in "
34184 : "dimension %d", dim);
34185 0 : goto fail;
34186 0 : } else if (unlikely(buf->suboffsets)) {
34187 0 : PyErr_SetString(PyExc_ValueError,
34188 : "Buffer exposes suboffsets but no strides");
34189 0 : goto fail;
34190 : }
34191 : }
34192 : return 1;
34193 : fail:
34194 : return 0;
34195 : }
34196 : static int
34197 0 : __pyx_check_suboffsets(Py_buffer *buf, int dim, int ndim, int spec)
34198 : {
34199 0 : CYTHON_UNUSED_VAR(ndim);
34200 0 : if (spec & __Pyx_MEMVIEW_DIRECT) {
34201 0 : if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
34202 0 : PyErr_Format(PyExc_ValueError,
34203 : "Buffer not compatible with direct access "
34204 : "in dimension %d.", dim);
34205 0 : goto fail;
34206 : }
34207 : }
34208 0 : if (spec & __Pyx_MEMVIEW_PTR) {
34209 0 : if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
34210 0 : PyErr_Format(PyExc_ValueError,
34211 : "Buffer is not indirectly accessible "
34212 : "in dimension %d.", dim);
34213 0 : goto fail;
34214 : }
34215 : }
34216 : return 1;
34217 : fail:
34218 : return 0;
34219 : }
34220 : static int
34221 0 : __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
34222 : {
34223 0 : int i;
34224 0 : if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
34225 : Py_ssize_t stride = 1;
34226 0 : for (i = 0; i < ndim; i++) {
34227 0 : if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
34228 0 : PyErr_SetString(PyExc_ValueError,
34229 : "Buffer not fortran contiguous.");
34230 0 : goto fail;
34231 : }
34232 0 : stride = stride * buf->shape[i];
34233 : }
34234 0 : } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
34235 0 : Py_ssize_t stride = 1;
34236 0 : for (i = ndim - 1; i >- 1; i--) {
34237 0 : if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
34238 0 : PyErr_SetString(PyExc_ValueError,
34239 : "Buffer not C contiguous.");
34240 0 : goto fail;
34241 : }
34242 0 : stride = stride * buf->shape[i];
34243 : }
34244 : }
34245 : return 1;
34246 : fail:
34247 : return 0;
34248 : }
34249 0 : static int __Pyx_ValidateAndInit_memviewslice(
34250 : int *axes_specs,
34251 : int c_or_f_flag,
34252 : int buf_flags,
34253 : int ndim,
34254 : __Pyx_TypeInfo *dtype,
34255 : __Pyx_BufFmt_StackElem stack[],
34256 : __Pyx_memviewslice *memviewslice,
34257 : PyObject *original_obj)
34258 : {
34259 0 : struct __pyx_memoryview_obj *memview, *new_memview;
34260 : __Pyx_RefNannyDeclarations
34261 0 : Py_buffer *buf;
34262 0 : int i, spec = 0, retval = -1;
34263 0 : __Pyx_BufFmt_Context ctx;
34264 0 : int from_memoryview = __pyx_memoryview_check(original_obj);
34265 0 : __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
34266 0 : if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
34267 : original_obj)->typeinfo)) {
34268 : memview = (struct __pyx_memoryview_obj *) original_obj;
34269 : new_memview = NULL;
34270 : } else {
34271 0 : memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
34272 : original_obj, buf_flags, 0, dtype);
34273 0 : new_memview = memview;
34274 0 : if (unlikely(!memview))
34275 0 : goto fail;
34276 : }
34277 0 : buf = &memview->view;
34278 0 : if (unlikely(buf->ndim != ndim)) {
34279 0 : PyErr_Format(PyExc_ValueError,
34280 : "Buffer has wrong number of dimensions (expected %d, got %d)",
34281 : ndim, buf->ndim);
34282 0 : goto fail;
34283 : }
34284 0 : if (new_memview) {
34285 0 : __Pyx_BufFmt_Init(&ctx, stack, dtype);
34286 0 : if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
34287 : }
34288 0 : if (unlikely((unsigned) buf->itemsize != dtype->size)) {
34289 0 : PyErr_Format(PyExc_ValueError,
34290 : "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
34291 : "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
34292 : buf->itemsize,
34293 : (buf->itemsize > 1) ? "s" : "",
34294 : dtype->name,
34295 : dtype->size,
34296 : (dtype->size > 1) ? "s" : "");
34297 0 : goto fail;
34298 : }
34299 0 : if (buf->len > 0) {
34300 0 : for (i = 0; i < ndim; i++) {
34301 0 : spec = axes_specs[i];
34302 0 : if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
34303 0 : goto fail;
34304 0 : if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
34305 0 : goto fail;
34306 : }
34307 0 : if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
34308 0 : goto fail;
34309 : }
34310 0 : if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
34311 : new_memview != NULL) == -1)) {
34312 0 : goto fail;
34313 : }
34314 0 : retval = 0;
34315 0 : goto no_fail;
34316 0 : fail:
34317 0 : Py_XDECREF(new_memview);
34318 0 : retval = -1;
34319 0 : no_fail:
34320 0 : __Pyx_RefNannyFinishContext();
34321 0 : return retval;
34322 : }
34323 :
34324 : /* ObjectToMemviewSlice */
34325 0 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *obj, int writable_flag) {
34326 0 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
34327 0 : __Pyx_BufFmt_StackElem stack[1];
34328 0 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
34329 0 : int retcode;
34330 0 : if (obj == Py_None) {
34331 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
34332 0 : return result;
34333 : }
34334 0 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
34335 : PyBUF_RECORDS_RO | writable_flag, 1,
34336 : &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, stack,
34337 : &result, obj);
34338 0 : if (unlikely(retcode == -1))
34339 0 : goto __pyx_fail;
34340 0 : return result;
34341 0 : __pyx_fail:
34342 0 : result.memview = NULL;
34343 0 : result.data = NULL;
34344 0 : return result;
34345 : }
34346 :
34347 : /* ObjectToMemviewSlice */
34348 0 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj, int writable_flag) {
34349 0 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
34350 0 : __Pyx_BufFmt_StackElem stack[1];
34351 0 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
34352 0 : int retcode;
34353 0 : if (obj == Py_None) {
34354 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
34355 0 : return result;
34356 : }
34357 0 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
34358 : PyBUF_RECORDS_RO | writable_flag, 1,
34359 : &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack,
34360 : &result, obj);
34361 0 : if (unlikely(retcode == -1))
34362 0 : goto __pyx_fail;
34363 0 : return result;
34364 0 : __pyx_fail:
34365 0 : result.memview = NULL;
34366 0 : result.data = NULL;
34367 0 : return result;
34368 : }
34369 :
34370 : /* CIntFromPyVerify */
34371 : #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
34372 : __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
34373 : #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
34374 : __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
34375 : #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
34376 : {\
34377 : func_type value = func_value;\
34378 : if (sizeof(target_type) < sizeof(func_type)) {\
34379 : if (unlikely(value != (func_type) (target_type) value)) {\
34380 : func_type zero = 0;\
34381 : if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
34382 : return (target_type) -1;\
34383 : if (is_unsigned && unlikely(value < zero))\
34384 : goto raise_neg_overflow;\
34385 : else\
34386 : goto raise_overflow;\
34387 : }\
34388 : }\
34389 : return (target_type) value;\
34390 : }
34391 :
34392 : /* PyUCS4InUnicode */
34393 : #if PY_VERSION_HEX < 0x03090000 || (defined(PyUnicode_WCHAR_KIND) && defined(PyUnicode_AS_UNICODE))
34394 : #if PY_VERSION_HEX < 0x03090000
34395 : #define __Pyx_PyUnicode_AS_UNICODE(op) PyUnicode_AS_UNICODE(op)
34396 : #define __Pyx_PyUnicode_GET_SIZE(op) PyUnicode_GET_SIZE(op)
34397 : #else
34398 : #define __Pyx_PyUnicode_AS_UNICODE(op) (((PyASCIIObject *)(op))->wstr)
34399 : #define __Pyx_PyUnicode_GET_SIZE(op) ((PyCompactUnicodeObject *)(op))->wstr_length
34400 : #endif
34401 : #if !defined(Py_UNICODE_SIZE) || Py_UNICODE_SIZE == 2
34402 : static int __Pyx_PyUnicodeBufferContainsUCS4_SP(Py_UNICODE* buffer, Py_ssize_t length, Py_UCS4 character) {
34403 : Py_UNICODE high_val, low_val;
34404 : Py_UNICODE* pos;
34405 : high_val = (Py_UNICODE) (0xD800 | (((character - 0x10000) >> 10) & ((1<<10)-1)));
34406 : low_val = (Py_UNICODE) (0xDC00 | ( (character - 0x10000) & ((1<<10)-1)));
34407 : for (pos=buffer; pos < buffer+length-1; pos++) {
34408 : if (unlikely((high_val == pos[0]) & (low_val == pos[1]))) return 1;
34409 : }
34410 : return 0;
34411 : }
34412 : #endif
34413 : static int __Pyx_PyUnicodeBufferContainsUCS4_BMP(Py_UNICODE* buffer, Py_ssize_t length, Py_UCS4 character) {
34414 : Py_UNICODE uchar;
34415 : Py_UNICODE* pos;
34416 : uchar = (Py_UNICODE) character;
34417 : for (pos=buffer; pos < buffer+length; pos++) {
34418 : if (unlikely(uchar == pos[0])) return 1;
34419 : }
34420 : return 0;
34421 : }
34422 : #endif
34423 : static CYTHON_INLINE int __Pyx_UnicodeContainsUCS4(PyObject* unicode, Py_UCS4 character) {
34424 : #if CYTHON_PEP393_ENABLED
34425 : const int kind = PyUnicode_KIND(unicode);
34426 : #ifdef PyUnicode_WCHAR_KIND
34427 : if (likely(kind != PyUnicode_WCHAR_KIND))
34428 : #endif
34429 : {
34430 : Py_ssize_t i;
34431 : const void* udata = PyUnicode_DATA(unicode);
34432 : const Py_ssize_t length = PyUnicode_GET_LENGTH(unicode);
34433 : for (i=0; i < length; i++) {
34434 : if (unlikely(character == PyUnicode_READ(kind, udata, i))) return 1;
34435 : }
34436 : return 0;
34437 : }
34438 : #elif PY_VERSION_HEX >= 0x03090000
34439 : #error Cannot use "UChar in Unicode" in Python 3.9 without PEP-393 unicode strings.
34440 : #elif !defined(PyUnicode_AS_UNICODE)
34441 : #error Cannot use "UChar in Unicode" in Python < 3.9 without Py_UNICODE support.
34442 : #endif
34443 : #if PY_VERSION_HEX < 0x03090000 || (defined(PyUnicode_WCHAR_KIND) && defined(PyUnicode_AS_UNICODE))
34444 : #if !defined(Py_UNICODE_SIZE) || Py_UNICODE_SIZE == 2
34445 : if ((sizeof(Py_UNICODE) == 2) && unlikely(character > 65535)) {
34446 : return __Pyx_PyUnicodeBufferContainsUCS4_SP(
34447 : __Pyx_PyUnicode_AS_UNICODE(unicode),
34448 : __Pyx_PyUnicode_GET_SIZE(unicode),
34449 : character);
34450 : } else
34451 : #endif
34452 : {
34453 : return __Pyx_PyUnicodeBufferContainsUCS4_BMP(
34454 : __Pyx_PyUnicode_AS_UNICODE(unicode),
34455 : __Pyx_PyUnicode_GET_SIZE(unicode),
34456 : character);
34457 : }
34458 : #endif
34459 : }
34460 :
34461 : /* Declarations */
34462 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
34463 : #ifdef __cplusplus
34464 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
34465 : return ::std::complex< float >(x, y);
34466 : }
34467 : #else
34468 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
34469 : return x + y*(__pyx_t_float_complex)_Complex_I;
34470 : }
34471 : #endif
34472 : #else
34473 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
34474 : __pyx_t_float_complex z;
34475 : z.real = x;
34476 : z.imag = y;
34477 : return z;
34478 : }
34479 : #endif
34480 :
34481 : /* Arithmetic */
34482 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
34483 : #else
34484 : static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
34485 : return (a.real == b.real) && (a.imag == b.imag);
34486 : }
34487 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
34488 : __pyx_t_float_complex z;
34489 : z.real = a.real + b.real;
34490 : z.imag = a.imag + b.imag;
34491 : return z;
34492 : }
34493 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
34494 : __pyx_t_float_complex z;
34495 : z.real = a.real - b.real;
34496 : z.imag = a.imag - b.imag;
34497 : return z;
34498 : }
34499 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
34500 : __pyx_t_float_complex z;
34501 : z.real = a.real * b.real - a.imag * b.imag;
34502 : z.imag = a.real * b.imag + a.imag * b.real;
34503 : return z;
34504 : }
34505 : #if 1
34506 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
34507 : if (b.imag == 0) {
34508 : return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
34509 : } else if (fabsf(b.real) >= fabsf(b.imag)) {
34510 : if (b.real == 0 && b.imag == 0) {
34511 : return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
34512 : } else {
34513 : float r = b.imag / b.real;
34514 : float s = (float)(1.0) / (b.real + b.imag * r);
34515 : return __pyx_t_float_complex_from_parts(
34516 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
34517 : }
34518 : } else {
34519 : float r = b.real / b.imag;
34520 : float s = (float)(1.0) / (b.imag + b.real * r);
34521 : return __pyx_t_float_complex_from_parts(
34522 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
34523 : }
34524 : }
34525 : #else
34526 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
34527 : if (b.imag == 0) {
34528 : return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
34529 : } else {
34530 : float denom = b.real * b.real + b.imag * b.imag;
34531 : return __pyx_t_float_complex_from_parts(
34532 : (a.real * b.real + a.imag * b.imag) / denom,
34533 : (a.imag * b.real - a.real * b.imag) / denom);
34534 : }
34535 : }
34536 : #endif
34537 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
34538 : __pyx_t_float_complex z;
34539 : z.real = -a.real;
34540 : z.imag = -a.imag;
34541 : return z;
34542 : }
34543 : static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
34544 : return (a.real == 0) && (a.imag == 0);
34545 : }
34546 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
34547 : __pyx_t_float_complex z;
34548 : z.real = a.real;
34549 : z.imag = -a.imag;
34550 : return z;
34551 : }
34552 : #if 1
34553 : static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
34554 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
34555 : return sqrtf(z.real*z.real + z.imag*z.imag);
34556 : #else
34557 : return hypotf(z.real, z.imag);
34558 : #endif
34559 : }
34560 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
34561 : __pyx_t_float_complex z;
34562 : float r, lnr, theta, z_r, z_theta;
34563 : if (b.imag == 0 && b.real == (int)b.real) {
34564 : if (b.real < 0) {
34565 : float denom = a.real * a.real + a.imag * a.imag;
34566 : a.real = a.real / denom;
34567 : a.imag = -a.imag / denom;
34568 : b.real = -b.real;
34569 : }
34570 : switch ((int)b.real) {
34571 : case 0:
34572 : z.real = 1;
34573 : z.imag = 0;
34574 : return z;
34575 : case 1:
34576 : return a;
34577 : case 2:
34578 : return __Pyx_c_prod_float(a, a);
34579 : case 3:
34580 : z = __Pyx_c_prod_float(a, a);
34581 : return __Pyx_c_prod_float(z, a);
34582 : case 4:
34583 : z = __Pyx_c_prod_float(a, a);
34584 : return __Pyx_c_prod_float(z, z);
34585 : }
34586 : }
34587 : if (a.imag == 0) {
34588 : if (a.real == 0) {
34589 : return a;
34590 : } else if ((b.imag == 0) && (a.real >= 0)) {
34591 : z.real = powf(a.real, b.real);
34592 : z.imag = 0;
34593 : return z;
34594 : } else if (a.real > 0) {
34595 : r = a.real;
34596 : theta = 0;
34597 : } else {
34598 : r = -a.real;
34599 : theta = atan2f(0.0, -1.0);
34600 : }
34601 : } else {
34602 : r = __Pyx_c_abs_float(a);
34603 : theta = atan2f(a.imag, a.real);
34604 : }
34605 : lnr = logf(r);
34606 : z_r = expf(lnr * b.real - theta * b.imag);
34607 : z_theta = theta * b.real + lnr * b.imag;
34608 : z.real = z_r * cosf(z_theta);
34609 : z.imag = z_r * sinf(z_theta);
34610 : return z;
34611 : }
34612 : #endif
34613 : #endif
34614 :
34615 : /* Declarations */
34616 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
34617 : #ifdef __cplusplus
34618 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
34619 : return ::std::complex< double >(x, y);
34620 : }
34621 : #else
34622 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
34623 : return x + y*(__pyx_t_double_complex)_Complex_I;
34624 : }
34625 : #endif
34626 : #else
34627 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
34628 : __pyx_t_double_complex z;
34629 : z.real = x;
34630 : z.imag = y;
34631 : return z;
34632 : }
34633 : #endif
34634 :
34635 : /* Arithmetic */
34636 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
34637 : #else
34638 : static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34639 : return (a.real == b.real) && (a.imag == b.imag);
34640 : }
34641 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34642 : __pyx_t_double_complex z;
34643 : z.real = a.real + b.real;
34644 : z.imag = a.imag + b.imag;
34645 : return z;
34646 : }
34647 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34648 : __pyx_t_double_complex z;
34649 : z.real = a.real - b.real;
34650 : z.imag = a.imag - b.imag;
34651 : return z;
34652 : }
34653 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34654 : __pyx_t_double_complex z;
34655 : z.real = a.real * b.real - a.imag * b.imag;
34656 : z.imag = a.real * b.imag + a.imag * b.real;
34657 : return z;
34658 : }
34659 : #if 1
34660 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34661 : if (b.imag == 0) {
34662 : return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
34663 : } else if (fabs(b.real) >= fabs(b.imag)) {
34664 : if (b.real == 0 && b.imag == 0) {
34665 : return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
34666 : } else {
34667 : double r = b.imag / b.real;
34668 : double s = (double)(1.0) / (b.real + b.imag * r);
34669 : return __pyx_t_double_complex_from_parts(
34670 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
34671 : }
34672 : } else {
34673 : double r = b.real / b.imag;
34674 : double s = (double)(1.0) / (b.imag + b.real * r);
34675 : return __pyx_t_double_complex_from_parts(
34676 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
34677 : }
34678 : }
34679 : #else
34680 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34681 : if (b.imag == 0) {
34682 : return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
34683 : } else {
34684 : double denom = b.real * b.real + b.imag * b.imag;
34685 : return __pyx_t_double_complex_from_parts(
34686 : (a.real * b.real + a.imag * b.imag) / denom,
34687 : (a.imag * b.real - a.real * b.imag) / denom);
34688 : }
34689 : }
34690 : #endif
34691 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
34692 : __pyx_t_double_complex z;
34693 : z.real = -a.real;
34694 : z.imag = -a.imag;
34695 : return z;
34696 : }
34697 : static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
34698 : return (a.real == 0) && (a.imag == 0);
34699 : }
34700 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
34701 : __pyx_t_double_complex z;
34702 : z.real = a.real;
34703 : z.imag = -a.imag;
34704 : return z;
34705 : }
34706 : #if 1
34707 : static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
34708 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
34709 : return sqrt(z.real*z.real + z.imag*z.imag);
34710 : #else
34711 : return hypot(z.real, z.imag);
34712 : #endif
34713 : }
34714 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34715 : __pyx_t_double_complex z;
34716 : double r, lnr, theta, z_r, z_theta;
34717 : if (b.imag == 0 && b.real == (int)b.real) {
34718 : if (b.real < 0) {
34719 : double denom = a.real * a.real + a.imag * a.imag;
34720 : a.real = a.real / denom;
34721 : a.imag = -a.imag / denom;
34722 : b.real = -b.real;
34723 : }
34724 : switch ((int)b.real) {
34725 : case 0:
34726 : z.real = 1;
34727 : z.imag = 0;
34728 : return z;
34729 : case 1:
34730 : return a;
34731 : case 2:
34732 : return __Pyx_c_prod_double(a, a);
34733 : case 3:
34734 : z = __Pyx_c_prod_double(a, a);
34735 : return __Pyx_c_prod_double(z, a);
34736 : case 4:
34737 : z = __Pyx_c_prod_double(a, a);
34738 : return __Pyx_c_prod_double(z, z);
34739 : }
34740 : }
34741 : if (a.imag == 0) {
34742 : if (a.real == 0) {
34743 : return a;
34744 : } else if ((b.imag == 0) && (a.real >= 0)) {
34745 : z.real = pow(a.real, b.real);
34746 : z.imag = 0;
34747 : return z;
34748 : } else if (a.real > 0) {
34749 : r = a.real;
34750 : theta = 0;
34751 : } else {
34752 : r = -a.real;
34753 : theta = atan2(0.0, -1.0);
34754 : }
34755 : } else {
34756 : r = __Pyx_c_abs_double(a);
34757 : theta = atan2(a.imag, a.real);
34758 : }
34759 : lnr = log(r);
34760 : z_r = exp(lnr * b.real - theta * b.imag);
34761 : z_theta = theta * b.real + lnr * b.imag;
34762 : z.real = z_r * cos(z_theta);
34763 : z.imag = z_r * sin(z_theta);
34764 : return z;
34765 : }
34766 : #endif
34767 : #endif
34768 :
34769 : /* Declarations */
34770 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
34771 : #ifdef __cplusplus
34772 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
34773 : return ::std::complex< long double >(x, y);
34774 : }
34775 : #else
34776 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
34777 : return x + y*(__pyx_t_long_double_complex)_Complex_I;
34778 : }
34779 : #endif
34780 : #else
34781 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
34782 : __pyx_t_long_double_complex z;
34783 : z.real = x;
34784 : z.imag = y;
34785 : return z;
34786 : }
34787 : #endif
34788 :
34789 : /* Arithmetic */
34790 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
34791 : #else
34792 : static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34793 : return (a.real == b.real) && (a.imag == b.imag);
34794 : }
34795 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34796 : __pyx_t_long_double_complex z;
34797 : z.real = a.real + b.real;
34798 : z.imag = a.imag + b.imag;
34799 : return z;
34800 : }
34801 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34802 : __pyx_t_long_double_complex z;
34803 : z.real = a.real - b.real;
34804 : z.imag = a.imag - b.imag;
34805 : return z;
34806 : }
34807 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34808 : __pyx_t_long_double_complex z;
34809 : z.real = a.real * b.real - a.imag * b.imag;
34810 : z.imag = a.real * b.imag + a.imag * b.real;
34811 : return z;
34812 : }
34813 : #if 1
34814 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34815 : if (b.imag == 0) {
34816 : return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
34817 : } else if (fabsl(b.real) >= fabsl(b.imag)) {
34818 : if (b.real == 0 && b.imag == 0) {
34819 : return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
34820 : } else {
34821 : long double r = b.imag / b.real;
34822 : long double s = (long double)(1.0) / (b.real + b.imag * r);
34823 : return __pyx_t_long_double_complex_from_parts(
34824 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
34825 : }
34826 : } else {
34827 : long double r = b.real / b.imag;
34828 : long double s = (long double)(1.0) / (b.imag + b.real * r);
34829 : return __pyx_t_long_double_complex_from_parts(
34830 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
34831 : }
34832 : }
34833 : #else
34834 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34835 : if (b.imag == 0) {
34836 : return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
34837 : } else {
34838 : long double denom = b.real * b.real + b.imag * b.imag;
34839 : return __pyx_t_long_double_complex_from_parts(
34840 : (a.real * b.real + a.imag * b.imag) / denom,
34841 : (a.imag * b.real - a.real * b.imag) / denom);
34842 : }
34843 : }
34844 : #endif
34845 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
34846 : __pyx_t_long_double_complex z;
34847 : z.real = -a.real;
34848 : z.imag = -a.imag;
34849 : return z;
34850 : }
34851 : static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
34852 : return (a.real == 0) && (a.imag == 0);
34853 : }
34854 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
34855 : __pyx_t_long_double_complex z;
34856 : z.real = a.real;
34857 : z.imag = -a.imag;
34858 : return z;
34859 : }
34860 : #if 1
34861 : static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex z) {
34862 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
34863 : return sqrtl(z.real*z.real + z.imag*z.imag);
34864 : #else
34865 : return hypotl(z.real, z.imag);
34866 : #endif
34867 : }
34868 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34869 : __pyx_t_long_double_complex z;
34870 : long double r, lnr, theta, z_r, z_theta;
34871 : if (b.imag == 0 && b.real == (int)b.real) {
34872 : if (b.real < 0) {
34873 : long double denom = a.real * a.real + a.imag * a.imag;
34874 : a.real = a.real / denom;
34875 : a.imag = -a.imag / denom;
34876 : b.real = -b.real;
34877 : }
34878 : switch ((int)b.real) {
34879 : case 0:
34880 : z.real = 1;
34881 : z.imag = 0;
34882 : return z;
34883 : case 1:
34884 : return a;
34885 : case 2:
34886 : return __Pyx_c_prod_long__double(a, a);
34887 : case 3:
34888 : z = __Pyx_c_prod_long__double(a, a);
34889 : return __Pyx_c_prod_long__double(z, a);
34890 : case 4:
34891 : z = __Pyx_c_prod_long__double(a, a);
34892 : return __Pyx_c_prod_long__double(z, z);
34893 : }
34894 : }
34895 : if (a.imag == 0) {
34896 : if (a.real == 0) {
34897 : return a;
34898 : } else if ((b.imag == 0) && (a.real >= 0)) {
34899 : z.real = powl(a.real, b.real);
34900 : z.imag = 0;
34901 : return z;
34902 : } else if (a.real > 0) {
34903 : r = a.real;
34904 : theta = 0;
34905 : } else {
34906 : r = -a.real;
34907 : theta = atan2l(0.0, -1.0);
34908 : }
34909 : } else {
34910 : r = __Pyx_c_abs_long__double(a);
34911 : theta = atan2l(a.imag, a.real);
34912 : }
34913 : lnr = logl(r);
34914 : z_r = expl(lnr * b.real - theta * b.imag);
34915 : z_theta = theta * b.real + lnr * b.imag;
34916 : z.real = z_r * cosl(z_theta);
34917 : z.imag = z_r * sinl(z_theta);
34918 : return z;
34919 : }
34920 : #endif
34921 : #endif
34922 :
34923 : /* MemviewSliceCopyTemplate */
34924 : static __Pyx_memviewslice
34925 0 : __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
34926 : const char *mode, int ndim,
34927 : size_t sizeof_dtype, int contig_flag,
34928 : int dtype_is_object)
34929 : {
34930 : __Pyx_RefNannyDeclarations
34931 0 : int i;
34932 0 : __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
34933 0 : struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
34934 0 : Py_buffer *buf = &from_memview->view;
34935 0 : PyObject *shape_tuple = NULL;
34936 0 : PyObject *temp_int = NULL;
34937 0 : struct __pyx_array_obj *array_obj = NULL;
34938 0 : struct __pyx_memoryview_obj *memview_obj = NULL;
34939 0 : __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
34940 0 : for (i = 0; i < ndim; i++) {
34941 0 : if (unlikely(from_mvs->suboffsets[i] >= 0)) {
34942 0 : PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
34943 : "indirect dimensions (axis %d)", i);
34944 0 : goto fail;
34945 : }
34946 : }
34947 0 : shape_tuple = PyTuple_New(ndim);
34948 0 : if (unlikely(!shape_tuple)) {
34949 0 : goto fail;
34950 : }
34951 : __Pyx_GOTREF(shape_tuple);
34952 0 : for(i = 0; i < ndim; i++) {
34953 0 : temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
34954 0 : if(unlikely(!temp_int)) {
34955 0 : goto fail;
34956 : } else {
34957 0 : PyTuple_SET_ITEM(shape_tuple, i, temp_int);
34958 0 : temp_int = NULL;
34959 : }
34960 : }
34961 0 : array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
34962 0 : if (unlikely(!array_obj)) {
34963 0 : goto fail;
34964 : }
34965 0 : __Pyx_GOTREF(array_obj);
34966 0 : memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
34967 : (PyObject *) array_obj, contig_flag,
34968 : dtype_is_object,
34969 0 : from_mvs->memview->typeinfo);
34970 0 : if (unlikely(!memview_obj))
34971 0 : goto fail;
34972 0 : if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
34973 0 : goto fail;
34974 0 : if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
34975 : dtype_is_object) < 0))
34976 0 : goto fail;
34977 0 : goto no_fail;
34978 0 : fail:
34979 0 : __Pyx_XDECREF(new_mvs.memview);
34980 0 : new_mvs.memview = NULL;
34981 0 : new_mvs.data = NULL;
34982 0 : no_fail:
34983 0 : __Pyx_XDECREF(shape_tuple);
34984 0 : __Pyx_XDECREF(temp_int);
34985 0 : __Pyx_XDECREF(array_obj);
34986 0 : __Pyx_RefNannyFinishContext();
34987 0 : return new_mvs;
34988 : }
34989 :
34990 : /* MemviewSliceInit */
34991 : static int
34992 0 : __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
34993 : int ndim,
34994 : __Pyx_memviewslice *memviewslice,
34995 : int memview_is_new_reference)
34996 : {
34997 : __Pyx_RefNannyDeclarations
34998 0 : int i, retval=-1;
34999 0 : Py_buffer *buf = &memview->view;
35000 0 : __Pyx_RefNannySetupContext("init_memviewslice", 0);
35001 0 : if (unlikely(memviewslice->memview || memviewslice->data)) {
35002 0 : PyErr_SetString(PyExc_ValueError,
35003 : "memviewslice is already initialized!");
35004 0 : goto fail;
35005 : }
35006 0 : if (buf->strides) {
35007 0 : for (i = 0; i < ndim; i++) {
35008 0 : memviewslice->strides[i] = buf->strides[i];
35009 : }
35010 : } else {
35011 0 : Py_ssize_t stride = buf->itemsize;
35012 0 : for (i = ndim - 1; i >= 0; i--) {
35013 0 : memviewslice->strides[i] = stride;
35014 0 : stride *= buf->shape[i];
35015 : }
35016 : }
35017 0 : for (i = 0; i < ndim; i++) {
35018 0 : memviewslice->shape[i] = buf->shape[i];
35019 0 : if (buf->suboffsets) {
35020 0 : memviewslice->suboffsets[i] = buf->suboffsets[i];
35021 : } else {
35022 0 : memviewslice->suboffsets[i] = -1;
35023 : }
35024 : }
35025 0 : memviewslice->memview = memview;
35026 0 : memviewslice->data = (char *)buf->buf;
35027 0 : if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
35028 0 : Py_INCREF(memview);
35029 : }
35030 0 : retval = 0;
35031 0 : goto no_fail;
35032 0 : fail:
35033 0 : memviewslice->memview = 0;
35034 0 : memviewslice->data = 0;
35035 0 : retval = -1;
35036 0 : no_fail:
35037 0 : __Pyx_RefNannyFinishContext();
35038 0 : return retval;
35039 : }
35040 : #ifndef Py_NO_RETURN
35041 : #define Py_NO_RETURN
35042 : #endif
35043 0 : static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
35044 0 : va_list vargs;
35045 0 : char msg[200];
35046 : #if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
35047 0 : va_start(vargs, fmt);
35048 : #else
35049 : va_start(vargs);
35050 : #endif
35051 0 : vsnprintf(msg, 200, fmt, vargs);
35052 0 : va_end(vargs);
35053 0 : Py_FatalError(msg);
35054 : }
35055 : static CYTHON_INLINE int
35056 : __pyx_add_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
35057 : PyThread_type_lock lock)
35058 : {
35059 : int result;
35060 : PyThread_acquire_lock(lock, 1);
35061 : result = (*acquisition_count)++;
35062 : PyThread_release_lock(lock);
35063 : return result;
35064 : }
35065 : static CYTHON_INLINE int
35066 : __pyx_sub_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
35067 : PyThread_type_lock lock)
35068 : {
35069 : int result;
35070 : PyThread_acquire_lock(lock, 1);
35071 : result = (*acquisition_count)--;
35072 : PyThread_release_lock(lock);
35073 : return result;
35074 : }
35075 : static CYTHON_INLINE void
35076 0 : __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
35077 : {
35078 0 : __pyx_nonatomic_int_type old_acquisition_count;
35079 0 : struct __pyx_memoryview_obj *memview = memslice->memview;
35080 0 : if (unlikely(!memview || (PyObject *) memview == Py_None)) {
35081 : return;
35082 : }
35083 0 : old_acquisition_count = __pyx_add_acquisition_count(memview);
35084 0 : if (unlikely(old_acquisition_count <= 0)) {
35085 0 : if (likely(old_acquisition_count == 0)) {
35086 0 : if (have_gil) {
35087 0 : Py_INCREF((PyObject *) memview);
35088 : } else {
35089 0 : PyGILState_STATE _gilstate = PyGILState_Ensure();
35090 0 : Py_INCREF((PyObject *) memview);
35091 0 : PyGILState_Release(_gilstate);
35092 : }
35093 : } else {
35094 0 : __pyx_fatalerror("Acquisition count is %d (line %d)",
35095 : old_acquisition_count+1, lineno);
35096 : }
35097 : }
35098 : }
35099 0 : static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice,
35100 : int have_gil, int lineno) {
35101 0 : __pyx_nonatomic_int_type old_acquisition_count;
35102 0 : struct __pyx_memoryview_obj *memview = memslice->memview;
35103 0 : if (unlikely(!memview || (PyObject *) memview == Py_None)) {
35104 0 : memslice->memview = NULL;
35105 0 : return;
35106 : }
35107 0 : old_acquisition_count = __pyx_sub_acquisition_count(memview);
35108 0 : memslice->data = NULL;
35109 0 : if (likely(old_acquisition_count > 1)) {
35110 0 : memslice->memview = NULL;
35111 0 : } else if (likely(old_acquisition_count == 1)) {
35112 0 : if (have_gil) {
35113 0 : Py_CLEAR(memslice->memview);
35114 : } else {
35115 0 : PyGILState_STATE _gilstate = PyGILState_Ensure();
35116 0 : Py_CLEAR(memslice->memview);
35117 0 : PyGILState_Release(_gilstate);
35118 : }
35119 : } else {
35120 0 : __pyx_fatalerror("Acquisition count is %d (line %d)",
35121 : old_acquisition_count-1, lineno);
35122 : }
35123 : }
35124 :
35125 : /* CIntFromPy */
35126 3 : static CYTHON_INLINE npy_intp __Pyx_PyInt_As_npy_intp(PyObject *x) {
35127 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35128 : #pragma GCC diagnostic push
35129 : #pragma GCC diagnostic ignored "-Wconversion"
35130 : #endif
35131 3 : const npy_intp neg_one = (npy_intp) -1, const_zero = (npy_intp) 0;
35132 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35133 : #pragma GCC diagnostic pop
35134 : #endif
35135 3 : const int is_unsigned = neg_one > const_zero;
35136 : #if PY_MAJOR_VERSION < 3
35137 : if (likely(PyInt_Check(x))) {
35138 : if ((sizeof(npy_intp) < sizeof(long))) {
35139 : __PYX_VERIFY_RETURN_INT(npy_intp, long, PyInt_AS_LONG(x))
35140 : } else {
35141 : long val = PyInt_AS_LONG(x);
35142 : if (is_unsigned && unlikely(val < 0)) {
35143 : goto raise_neg_overflow;
35144 : }
35145 : return (npy_intp) val;
35146 : }
35147 : }
35148 : #endif
35149 3 : if (unlikely(!PyLong_Check(x))) {
35150 0 : npy_intp val;
35151 0 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
35152 0 : if (!tmp) return (npy_intp) -1;
35153 0 : val = __Pyx_PyInt_As_npy_intp(tmp);
35154 0 : Py_DECREF(tmp);
35155 0 : return val;
35156 : }
35157 3 : if (is_unsigned) {
35158 : #if CYTHON_USE_PYLONG_INTERNALS
35159 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
35160 : goto raise_neg_overflow;
35161 : } else if (__Pyx_PyLong_IsCompact(x)) {
35162 : __PYX_VERIFY_RETURN_INT(npy_intp, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
35163 : } else {
35164 : const digit* digits = __Pyx_PyLong_Digits(x);
35165 : assert(__Pyx_PyLong_DigitCount(x) > 1);
35166 : switch (__Pyx_PyLong_DigitCount(x)) {
35167 : case 2:
35168 : if ((8 * sizeof(npy_intp) > 1 * PyLong_SHIFT)) {
35169 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35170 : __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35171 : } else if ((8 * sizeof(npy_intp) >= 2 * PyLong_SHIFT)) {
35172 : return (npy_intp) (((((npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0]));
35173 : }
35174 : }
35175 : break;
35176 : case 3:
35177 : if ((8 * sizeof(npy_intp) > 2 * PyLong_SHIFT)) {
35178 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35179 : __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35180 : } else if ((8 * sizeof(npy_intp) >= 3 * PyLong_SHIFT)) {
35181 : return (npy_intp) (((((((npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0]));
35182 : }
35183 : }
35184 : break;
35185 : case 4:
35186 : if ((8 * sizeof(npy_intp) > 3 * PyLong_SHIFT)) {
35187 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35188 : __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35189 : } else if ((8 * sizeof(npy_intp) >= 4 * PyLong_SHIFT)) {
35190 : return (npy_intp) (((((((((npy_intp)digits[3]) << PyLong_SHIFT) | (npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0]));
35191 : }
35192 : }
35193 : break;
35194 : }
35195 : }
35196 : #endif
35197 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
35198 : if (unlikely(Py_SIZE(x) < 0)) {
35199 : goto raise_neg_overflow;
35200 : }
35201 : #else
35202 : {
35203 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
35204 : if (unlikely(result < 0))
35205 : return (npy_intp) -1;
35206 : if (unlikely(result == 1))
35207 : goto raise_neg_overflow;
35208 : }
35209 : #endif
35210 : if ((sizeof(npy_intp) <= sizeof(unsigned long))) {
35211 : __PYX_VERIFY_RETURN_INT_EXC(npy_intp, unsigned long, PyLong_AsUnsignedLong(x))
35212 : #ifdef HAVE_LONG_LONG
35213 : } else if ((sizeof(npy_intp) <= sizeof(unsigned PY_LONG_LONG))) {
35214 : __PYX_VERIFY_RETURN_INT_EXC(npy_intp, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
35215 : #endif
35216 : }
35217 : } else {
35218 : #if CYTHON_USE_PYLONG_INTERNALS
35219 3 : if (__Pyx_PyLong_IsCompact(x)) {
35220 3 : __PYX_VERIFY_RETURN_INT(npy_intp, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
35221 : } else {
35222 0 : const digit* digits = __Pyx_PyLong_Digits(x);
35223 0 : assert(__Pyx_PyLong_DigitCount(x) > 1);
35224 0 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
35225 : case -2:
35226 0 : if ((8 * sizeof(npy_intp) - 1 > 1 * PyLong_SHIFT)) {
35227 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35228 0 : __PYX_VERIFY_RETURN_INT(npy_intp, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35229 : } else if ((8 * sizeof(npy_intp) - 1 > 2 * PyLong_SHIFT)) {
35230 : return (npy_intp) (((npy_intp)-1)*(((((npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
35231 : }
35232 : }
35233 : break;
35234 : case 2:
35235 0 : if ((8 * sizeof(npy_intp) > 1 * PyLong_SHIFT)) {
35236 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35237 0 : __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35238 : } else if ((8 * sizeof(npy_intp) - 1 > 2 * PyLong_SHIFT)) {
35239 : return (npy_intp) ((((((npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
35240 : }
35241 : }
35242 : break;
35243 : case -3:
35244 : if ((8 * sizeof(npy_intp) - 1 > 2 * PyLong_SHIFT)) {
35245 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35246 : __PYX_VERIFY_RETURN_INT(npy_intp, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35247 : } else if ((8 * sizeof(npy_intp) - 1 > 3 * PyLong_SHIFT)) {
35248 : return (npy_intp) (((npy_intp)-1)*(((((((npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
35249 : }
35250 : }
35251 : break;
35252 : case 3:
35253 : if ((8 * sizeof(npy_intp) > 2 * PyLong_SHIFT)) {
35254 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35255 : __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35256 : } else if ((8 * sizeof(npy_intp) - 1 > 3 * PyLong_SHIFT)) {
35257 : return (npy_intp) ((((((((npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
35258 : }
35259 : }
35260 : break;
35261 : case -4:
35262 : if ((8 * sizeof(npy_intp) - 1 > 3 * PyLong_SHIFT)) {
35263 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35264 : __PYX_VERIFY_RETURN_INT(npy_intp, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35265 : } else if ((8 * sizeof(npy_intp) - 1 > 4 * PyLong_SHIFT)) {
35266 : return (npy_intp) (((npy_intp)-1)*(((((((((npy_intp)digits[3]) << PyLong_SHIFT) | (npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
35267 : }
35268 : }
35269 : break;
35270 : case 4:
35271 : if ((8 * sizeof(npy_intp) > 3 * PyLong_SHIFT)) {
35272 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35273 : __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35274 : } else if ((8 * sizeof(npy_intp) - 1 > 4 * PyLong_SHIFT)) {
35275 : return (npy_intp) ((((((((((npy_intp)digits[3]) << PyLong_SHIFT) | (npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
35276 : }
35277 : }
35278 : break;
35279 : }
35280 : }
35281 : #endif
35282 0 : if ((sizeof(npy_intp) <= sizeof(long))) {
35283 0 : __PYX_VERIFY_RETURN_INT_EXC(npy_intp, long, PyLong_AsLong(x))
35284 : #ifdef HAVE_LONG_LONG
35285 : } else if ((sizeof(npy_intp) <= sizeof(PY_LONG_LONG))) {
35286 : __PYX_VERIFY_RETURN_INT_EXC(npy_intp, PY_LONG_LONG, PyLong_AsLongLong(x))
35287 : #endif
35288 : }
35289 : }
35290 : {
35291 : npy_intp val;
35292 : int ret = -1;
35293 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
35294 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
35295 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
35296 : if (unlikely(bytes_copied == -1)) {
35297 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
35298 : goto raise_overflow;
35299 : } else {
35300 : ret = 0;
35301 : }
35302 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
35303 : int one = 1; int is_little = (int)*(unsigned char *)&one;
35304 : unsigned char *bytes = (unsigned char *)&val;
35305 : ret = _PyLong_AsByteArray((PyLongObject *)x,
35306 : bytes, sizeof(val),
35307 : is_little, !is_unsigned);
35308 : #else
35309 : PyObject *v;
35310 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
35311 : int bits, remaining_bits, is_negative = 0;
35312 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
35313 : if (likely(PyLong_CheckExact(x))) {
35314 : v = __Pyx_NewRef(x);
35315 : } else {
35316 : v = PyNumber_Long(x);
35317 : if (unlikely(!v)) return (npy_intp) -1;
35318 : assert(PyLong_CheckExact(v));
35319 : }
35320 : {
35321 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
35322 : if (unlikely(result < 0)) {
35323 : Py_DECREF(v);
35324 : return (npy_intp) -1;
35325 : }
35326 : is_negative = result == 1;
35327 : }
35328 : if (is_unsigned && unlikely(is_negative)) {
35329 : Py_DECREF(v);
35330 : goto raise_neg_overflow;
35331 : } else if (is_negative) {
35332 : stepval = PyNumber_Invert(v);
35333 : Py_DECREF(v);
35334 : if (unlikely(!stepval))
35335 : return (npy_intp) -1;
35336 : } else {
35337 : stepval = v;
35338 : }
35339 : v = NULL;
35340 : val = (npy_intp) 0;
35341 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
35342 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
35343 : for (bits = 0; bits < (int) sizeof(npy_intp) * 8 - chunk_size; bits += chunk_size) {
35344 : PyObject *tmp, *digit;
35345 : long idigit;
35346 : digit = PyNumber_And(stepval, mask);
35347 : if (unlikely(!digit)) goto done;
35348 : idigit = PyLong_AsLong(digit);
35349 : Py_DECREF(digit);
35350 : if (unlikely(idigit < 0)) goto done;
35351 : val |= ((npy_intp) idigit) << bits;
35352 : tmp = PyNumber_Rshift(stepval, shift);
35353 : if (unlikely(!tmp)) goto done;
35354 : Py_DECREF(stepval); stepval = tmp;
35355 : }
35356 : Py_DECREF(shift); shift = NULL;
35357 : Py_DECREF(mask); mask = NULL;
35358 : {
35359 : long idigit = PyLong_AsLong(stepval);
35360 : if (unlikely(idigit < 0)) goto done;
35361 : remaining_bits = ((int) sizeof(npy_intp) * 8) - bits - (is_unsigned ? 0 : 1);
35362 : if (unlikely(idigit >= (1L << remaining_bits)))
35363 : goto raise_overflow;
35364 : val |= ((npy_intp) idigit) << bits;
35365 : }
35366 : if (!is_unsigned) {
35367 : if (unlikely(val & (((npy_intp) 1) << (sizeof(npy_intp) * 8 - 1))))
35368 : goto raise_overflow;
35369 : if (is_negative)
35370 : val = ~val;
35371 : }
35372 : ret = 0;
35373 : done:
35374 : Py_XDECREF(shift);
35375 : Py_XDECREF(mask);
35376 : Py_XDECREF(stepval);
35377 : #endif
35378 : if (unlikely(ret))
35379 : return (npy_intp) -1;
35380 : return val;
35381 : }
35382 : raise_overflow:
35383 : PyErr_SetString(PyExc_OverflowError,
35384 : "value too large to convert to npy_intp");
35385 : return (npy_intp) -1;
35386 : raise_neg_overflow:
35387 : PyErr_SetString(PyExc_OverflowError,
35388 : "can't convert negative value to npy_intp");
35389 : return (npy_intp) -1;
35390 : }
35391 :
35392 : /* CIntToPy */
35393 0 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
35394 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35395 : #pragma GCC diagnostic push
35396 : #pragma GCC diagnostic ignored "-Wconversion"
35397 : #endif
35398 0 : const long neg_one = (long) -1, const_zero = (long) 0;
35399 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35400 : #pragma GCC diagnostic pop
35401 : #endif
35402 0 : const int is_unsigned = neg_one > const_zero;
35403 0 : if (is_unsigned) {
35404 : if (sizeof(long) < sizeof(long)) {
35405 : return PyInt_FromLong((long) value);
35406 : } else if (sizeof(long) <= sizeof(unsigned long)) {
35407 : return PyLong_FromUnsignedLong((unsigned long) value);
35408 : #ifdef HAVE_LONG_LONG
35409 : } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
35410 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
35411 : #endif
35412 : }
35413 : } else {
35414 0 : if (sizeof(long) <= sizeof(long)) {
35415 0 : return PyInt_FromLong((long) value);
35416 : #ifdef HAVE_LONG_LONG
35417 : } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
35418 : return PyLong_FromLongLong((PY_LONG_LONG) value);
35419 : #endif
35420 : }
35421 : }
35422 : {
35423 : unsigned char *bytes = (unsigned char *)&value;
35424 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
35425 : if (is_unsigned) {
35426 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
35427 : } else {
35428 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
35429 : }
35430 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
35431 : int one = 1; int little = (int)*(unsigned char *)&one;
35432 : return _PyLong_FromByteArray(bytes, sizeof(long),
35433 : little, !is_unsigned);
35434 : #else
35435 : int one = 1; int little = (int)*(unsigned char *)&one;
35436 : PyObject *from_bytes, *result = NULL;
35437 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
35438 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
35439 : if (!from_bytes) return NULL;
35440 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
35441 : if (!py_bytes) goto limited_bad;
35442 : order_str = PyUnicode_FromString(little ? "little" : "big");
35443 : if (!order_str) goto limited_bad;
35444 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
35445 : if (!arg_tuple) goto limited_bad;
35446 : if (!is_unsigned) {
35447 : kwds = PyDict_New();
35448 : if (!kwds) goto limited_bad;
35449 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
35450 : }
35451 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
35452 : limited_bad:
35453 : Py_XDECREF(kwds);
35454 : Py_XDECREF(arg_tuple);
35455 : Py_XDECREF(order_str);
35456 : Py_XDECREF(py_bytes);
35457 : Py_XDECREF(from_bytes);
35458 : return result;
35459 : #endif
35460 : }
35461 : }
35462 :
35463 : /* CIntToPy */
35464 6 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_intp(npy_intp value) {
35465 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35466 : #pragma GCC diagnostic push
35467 : #pragma GCC diagnostic ignored "-Wconversion"
35468 : #endif
35469 6 : const npy_intp neg_one = (npy_intp) -1, const_zero = (npy_intp) 0;
35470 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35471 : #pragma GCC diagnostic pop
35472 : #endif
35473 6 : const int is_unsigned = neg_one > const_zero;
35474 6 : if (is_unsigned) {
35475 : if (sizeof(npy_intp) < sizeof(long)) {
35476 : return PyInt_FromLong((long) value);
35477 : } else if (sizeof(npy_intp) <= sizeof(unsigned long)) {
35478 : return PyLong_FromUnsignedLong((unsigned long) value);
35479 : #ifdef HAVE_LONG_LONG
35480 : } else if (sizeof(npy_intp) <= sizeof(unsigned PY_LONG_LONG)) {
35481 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
35482 : #endif
35483 : }
35484 : } else {
35485 6 : if (sizeof(npy_intp) <= sizeof(long)) {
35486 6 : return PyInt_FromLong((long) value);
35487 : #ifdef HAVE_LONG_LONG
35488 : } else if (sizeof(npy_intp) <= sizeof(PY_LONG_LONG)) {
35489 : return PyLong_FromLongLong((PY_LONG_LONG) value);
35490 : #endif
35491 : }
35492 : }
35493 : {
35494 : unsigned char *bytes = (unsigned char *)&value;
35495 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
35496 : if (is_unsigned) {
35497 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
35498 : } else {
35499 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
35500 : }
35501 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
35502 : int one = 1; int little = (int)*(unsigned char *)&one;
35503 : return _PyLong_FromByteArray(bytes, sizeof(npy_intp),
35504 : little, !is_unsigned);
35505 : #else
35506 : int one = 1; int little = (int)*(unsigned char *)&one;
35507 : PyObject *from_bytes, *result = NULL;
35508 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
35509 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
35510 : if (!from_bytes) return NULL;
35511 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(npy_intp));
35512 : if (!py_bytes) goto limited_bad;
35513 : order_str = PyUnicode_FromString(little ? "little" : "big");
35514 : if (!order_str) goto limited_bad;
35515 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
35516 : if (!arg_tuple) goto limited_bad;
35517 : if (!is_unsigned) {
35518 : kwds = PyDict_New();
35519 : if (!kwds) goto limited_bad;
35520 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
35521 : }
35522 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
35523 : limited_bad:
35524 : Py_XDECREF(kwds);
35525 : Py_XDECREF(arg_tuple);
35526 : Py_XDECREF(order_str);
35527 : Py_XDECREF(py_bytes);
35528 : Py_XDECREF(from_bytes);
35529 : return result;
35530 : #endif
35531 : }
35532 : }
35533 :
35534 : /* CIntToPy */
35535 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) {
35536 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35537 : #pragma GCC diagnostic push
35538 : #pragma GCC diagnostic ignored "-Wconversion"
35539 : #endif
35540 : const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0;
35541 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35542 : #pragma GCC diagnostic pop
35543 : #endif
35544 : const int is_unsigned = neg_one > const_zero;
35545 : if (is_unsigned) {
35546 : if (sizeof(npy_int32) < sizeof(long)) {
35547 : return PyInt_FromLong((long) value);
35548 : } else if (sizeof(npy_int32) <= sizeof(unsigned long)) {
35549 : return PyLong_FromUnsignedLong((unsigned long) value);
35550 : #ifdef HAVE_LONG_LONG
35551 : } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
35552 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
35553 : #endif
35554 : }
35555 : } else {
35556 : if (sizeof(npy_int32) <= sizeof(long)) {
35557 : return PyInt_FromLong((long) value);
35558 : #ifdef HAVE_LONG_LONG
35559 : } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
35560 : return PyLong_FromLongLong((PY_LONG_LONG) value);
35561 : #endif
35562 : }
35563 : }
35564 : {
35565 : unsigned char *bytes = (unsigned char *)&value;
35566 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
35567 : if (is_unsigned) {
35568 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
35569 : } else {
35570 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
35571 : }
35572 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
35573 : int one = 1; int little = (int)*(unsigned char *)&one;
35574 : return _PyLong_FromByteArray(bytes, sizeof(npy_int32),
35575 : little, !is_unsigned);
35576 : #else
35577 : int one = 1; int little = (int)*(unsigned char *)&one;
35578 : PyObject *from_bytes, *result = NULL;
35579 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
35580 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
35581 : if (!from_bytes) return NULL;
35582 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(npy_int32));
35583 : if (!py_bytes) goto limited_bad;
35584 : order_str = PyUnicode_FromString(little ? "little" : "big");
35585 : if (!order_str) goto limited_bad;
35586 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
35587 : if (!arg_tuple) goto limited_bad;
35588 : if (!is_unsigned) {
35589 : kwds = PyDict_New();
35590 : if (!kwds) goto limited_bad;
35591 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
35592 : }
35593 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
35594 : limited_bad:
35595 : Py_XDECREF(kwds);
35596 : Py_XDECREF(arg_tuple);
35597 : Py_XDECREF(order_str);
35598 : Py_XDECREF(py_bytes);
35599 : Py_XDECREF(from_bytes);
35600 : return result;
35601 : #endif
35602 : }
35603 : }
35604 :
35605 : /* CIntToPy */
35606 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) {
35607 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35608 : #pragma GCC diagnostic push
35609 : #pragma GCC diagnostic ignored "-Wconversion"
35610 : #endif
35611 : const npy_int64 neg_one = (npy_int64) -1, const_zero = (npy_int64) 0;
35612 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35613 : #pragma GCC diagnostic pop
35614 : #endif
35615 : const int is_unsigned = neg_one > const_zero;
35616 : if (is_unsigned) {
35617 : if (sizeof(npy_int64) < sizeof(long)) {
35618 : return PyInt_FromLong((long) value);
35619 : } else if (sizeof(npy_int64) <= sizeof(unsigned long)) {
35620 : return PyLong_FromUnsignedLong((unsigned long) value);
35621 : #ifdef HAVE_LONG_LONG
35622 : } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) {
35623 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
35624 : #endif
35625 : }
35626 : } else {
35627 : if (sizeof(npy_int64) <= sizeof(long)) {
35628 : return PyInt_FromLong((long) value);
35629 : #ifdef HAVE_LONG_LONG
35630 : } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) {
35631 : return PyLong_FromLongLong((PY_LONG_LONG) value);
35632 : #endif
35633 : }
35634 : }
35635 : {
35636 : unsigned char *bytes = (unsigned char *)&value;
35637 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
35638 : if (is_unsigned) {
35639 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
35640 : } else {
35641 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
35642 : }
35643 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
35644 : int one = 1; int little = (int)*(unsigned char *)&one;
35645 : return _PyLong_FromByteArray(bytes, sizeof(npy_int64),
35646 : little, !is_unsigned);
35647 : #else
35648 : int one = 1; int little = (int)*(unsigned char *)&one;
35649 : PyObject *from_bytes, *result = NULL;
35650 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
35651 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
35652 : if (!from_bytes) return NULL;
35653 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(npy_int64));
35654 : if (!py_bytes) goto limited_bad;
35655 : order_str = PyUnicode_FromString(little ? "little" : "big");
35656 : if (!order_str) goto limited_bad;
35657 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
35658 : if (!arg_tuple) goto limited_bad;
35659 : if (!is_unsigned) {
35660 : kwds = PyDict_New();
35661 : if (!kwds) goto limited_bad;
35662 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
35663 : }
35664 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
35665 : limited_bad:
35666 : Py_XDECREF(kwds);
35667 : Py_XDECREF(arg_tuple);
35668 : Py_XDECREF(order_str);
35669 : Py_XDECREF(py_bytes);
35670 : Py_XDECREF(from_bytes);
35671 : return result;
35672 : #endif
35673 : }
35674 : }
35675 :
35676 : /* ImportNumPyArray */
35677 1 : static PyObject* __Pyx__ImportNumPyArray(void) {
35678 1 : PyObject *numpy_module, *ndarray_object = NULL;
35679 1 : numpy_module = __Pyx_Import(__pyx_n_s_numpy, NULL, 0);
35680 1 : if (likely(numpy_module)) {
35681 1 : ndarray_object = PyObject_GetAttrString(numpy_module, "ndarray");
35682 1 : Py_DECREF(numpy_module);
35683 : }
35684 1 : if (unlikely(!ndarray_object)) {
35685 0 : PyErr_Clear();
35686 : }
35687 1 : if (unlikely(!ndarray_object || !PyObject_TypeCheck(ndarray_object, &PyType_Type))) {
35688 0 : Py_XDECREF(ndarray_object);
35689 0 : Py_INCREF(Py_None);
35690 : ndarray_object = Py_None;
35691 : }
35692 1 : return ndarray_object;
35693 : }
35694 3 : static CYTHON_INLINE PyObject* __Pyx_ImportNumPyArrayTypeIfAvailable(void) {
35695 3 : if (unlikely(!__pyx_numpy_ndarray)) {
35696 1 : __pyx_numpy_ndarray = __Pyx__ImportNumPyArray();
35697 : }
35698 3 : Py_INCREF(__pyx_numpy_ndarray);
35699 3 : return __pyx_numpy_ndarray;
35700 : }
35701 :
35702 : /* CIntFromPy */
35703 0 : static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
35704 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35705 : #pragma GCC diagnostic push
35706 : #pragma GCC diagnostic ignored "-Wconversion"
35707 : #endif
35708 0 : const int neg_one = (int) -1, const_zero = (int) 0;
35709 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35710 : #pragma GCC diagnostic pop
35711 : #endif
35712 0 : const int is_unsigned = neg_one > const_zero;
35713 : #if PY_MAJOR_VERSION < 3
35714 : if (likely(PyInt_Check(x))) {
35715 : if ((sizeof(int) < sizeof(long))) {
35716 : __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
35717 : } else {
35718 : long val = PyInt_AS_LONG(x);
35719 : if (is_unsigned && unlikely(val < 0)) {
35720 : goto raise_neg_overflow;
35721 : }
35722 : return (int) val;
35723 : }
35724 : }
35725 : #endif
35726 0 : if (unlikely(!PyLong_Check(x))) {
35727 0 : int val;
35728 0 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
35729 0 : if (!tmp) return (int) -1;
35730 0 : val = __Pyx_PyInt_As_int(tmp);
35731 0 : Py_DECREF(tmp);
35732 0 : return val;
35733 : }
35734 0 : if (is_unsigned) {
35735 : #if CYTHON_USE_PYLONG_INTERNALS
35736 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
35737 : goto raise_neg_overflow;
35738 : } else if (__Pyx_PyLong_IsCompact(x)) {
35739 : __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
35740 : } else {
35741 : const digit* digits = __Pyx_PyLong_Digits(x);
35742 : assert(__Pyx_PyLong_DigitCount(x) > 1);
35743 : switch (__Pyx_PyLong_DigitCount(x)) {
35744 : case 2:
35745 : if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
35746 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35747 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35748 : } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
35749 : return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
35750 : }
35751 : }
35752 : break;
35753 : case 3:
35754 : if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
35755 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35756 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35757 : } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
35758 : return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
35759 : }
35760 : }
35761 : break;
35762 : case 4:
35763 : if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
35764 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35765 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35766 : } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
35767 : return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
35768 : }
35769 : }
35770 : break;
35771 : }
35772 : }
35773 : #endif
35774 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
35775 : if (unlikely(Py_SIZE(x) < 0)) {
35776 : goto raise_neg_overflow;
35777 : }
35778 : #else
35779 : {
35780 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
35781 : if (unlikely(result < 0))
35782 : return (int) -1;
35783 : if (unlikely(result == 1))
35784 : goto raise_neg_overflow;
35785 : }
35786 : #endif
35787 : if ((sizeof(int) <= sizeof(unsigned long))) {
35788 : __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
35789 : #ifdef HAVE_LONG_LONG
35790 : } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
35791 : __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
35792 : #endif
35793 : }
35794 : } else {
35795 : #if CYTHON_USE_PYLONG_INTERNALS
35796 0 : if (__Pyx_PyLong_IsCompact(x)) {
35797 0 : __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
35798 : } else {
35799 0 : const digit* digits = __Pyx_PyLong_Digits(x);
35800 0 : assert(__Pyx_PyLong_DigitCount(x) > 1);
35801 0 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
35802 : case -2:
35803 0 : if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
35804 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35805 0 : __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35806 : } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
35807 : return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35808 : }
35809 : }
35810 : break;
35811 : case 2:
35812 0 : if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
35813 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35814 0 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35815 : } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
35816 : return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35817 : }
35818 : }
35819 : break;
35820 : case -3:
35821 : if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
35822 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35823 : __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35824 : } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
35825 : return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35826 : }
35827 : }
35828 : break;
35829 : case 3:
35830 : if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
35831 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35832 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35833 : } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
35834 : return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35835 : }
35836 : }
35837 : break;
35838 : case -4:
35839 : if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
35840 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35841 : __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35842 : } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
35843 : return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35844 : }
35845 : }
35846 : break;
35847 : case 4:
35848 : if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
35849 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35850 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35851 : } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
35852 : return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35853 : }
35854 : }
35855 : break;
35856 : }
35857 : }
35858 : #endif
35859 0 : if ((sizeof(int) <= sizeof(long))) {
35860 0 : __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
35861 : #ifdef HAVE_LONG_LONG
35862 : } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
35863 : __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
35864 : #endif
35865 : }
35866 : }
35867 : {
35868 : int val;
35869 : int ret = -1;
35870 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
35871 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
35872 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
35873 : if (unlikely(bytes_copied == -1)) {
35874 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
35875 : goto raise_overflow;
35876 : } else {
35877 : ret = 0;
35878 : }
35879 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
35880 : int one = 1; int is_little = (int)*(unsigned char *)&one;
35881 : unsigned char *bytes = (unsigned char *)&val;
35882 : ret = _PyLong_AsByteArray((PyLongObject *)x,
35883 : bytes, sizeof(val),
35884 : is_little, !is_unsigned);
35885 : #else
35886 : PyObject *v;
35887 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
35888 : int bits, remaining_bits, is_negative = 0;
35889 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
35890 : if (likely(PyLong_CheckExact(x))) {
35891 : v = __Pyx_NewRef(x);
35892 : } else {
35893 : v = PyNumber_Long(x);
35894 : if (unlikely(!v)) return (int) -1;
35895 : assert(PyLong_CheckExact(v));
35896 : }
35897 : {
35898 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
35899 : if (unlikely(result < 0)) {
35900 : Py_DECREF(v);
35901 : return (int) -1;
35902 : }
35903 : is_negative = result == 1;
35904 : }
35905 : if (is_unsigned && unlikely(is_negative)) {
35906 : Py_DECREF(v);
35907 : goto raise_neg_overflow;
35908 : } else if (is_negative) {
35909 : stepval = PyNumber_Invert(v);
35910 : Py_DECREF(v);
35911 : if (unlikely(!stepval))
35912 : return (int) -1;
35913 : } else {
35914 : stepval = v;
35915 : }
35916 : v = NULL;
35917 : val = (int) 0;
35918 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
35919 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
35920 : for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
35921 : PyObject *tmp, *digit;
35922 : long idigit;
35923 : digit = PyNumber_And(stepval, mask);
35924 : if (unlikely(!digit)) goto done;
35925 : idigit = PyLong_AsLong(digit);
35926 : Py_DECREF(digit);
35927 : if (unlikely(idigit < 0)) goto done;
35928 : val |= ((int) idigit) << bits;
35929 : tmp = PyNumber_Rshift(stepval, shift);
35930 : if (unlikely(!tmp)) goto done;
35931 : Py_DECREF(stepval); stepval = tmp;
35932 : }
35933 : Py_DECREF(shift); shift = NULL;
35934 : Py_DECREF(mask); mask = NULL;
35935 : {
35936 : long idigit = PyLong_AsLong(stepval);
35937 : if (unlikely(idigit < 0)) goto done;
35938 : remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
35939 : if (unlikely(idigit >= (1L << remaining_bits)))
35940 : goto raise_overflow;
35941 : val |= ((int) idigit) << bits;
35942 : }
35943 : if (!is_unsigned) {
35944 : if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
35945 : goto raise_overflow;
35946 : if (is_negative)
35947 : val = ~val;
35948 : }
35949 : ret = 0;
35950 : done:
35951 : Py_XDECREF(shift);
35952 : Py_XDECREF(mask);
35953 : Py_XDECREF(stepval);
35954 : #endif
35955 : if (unlikely(ret))
35956 : return (int) -1;
35957 : return val;
35958 : }
35959 0 : raise_overflow:
35960 0 : PyErr_SetString(PyExc_OverflowError,
35961 : "value too large to convert to int");
35962 0 : return (int) -1;
35963 : raise_neg_overflow:
35964 : PyErr_SetString(PyExc_OverflowError,
35965 : "can't convert negative value to int");
35966 : return (int) -1;
35967 : }
35968 :
35969 : /* CIntFromPy */
35970 0 : static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
35971 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35972 : #pragma GCC diagnostic push
35973 : #pragma GCC diagnostic ignored "-Wconversion"
35974 : #endif
35975 0 : const long neg_one = (long) -1, const_zero = (long) 0;
35976 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35977 : #pragma GCC diagnostic pop
35978 : #endif
35979 0 : const int is_unsigned = neg_one > const_zero;
35980 : #if PY_MAJOR_VERSION < 3
35981 : if (likely(PyInt_Check(x))) {
35982 : if ((sizeof(long) < sizeof(long))) {
35983 : __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
35984 : } else {
35985 : long val = PyInt_AS_LONG(x);
35986 : if (is_unsigned && unlikely(val < 0)) {
35987 : goto raise_neg_overflow;
35988 : }
35989 : return (long) val;
35990 : }
35991 : }
35992 : #endif
35993 0 : if (unlikely(!PyLong_Check(x))) {
35994 0 : long val;
35995 0 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
35996 0 : if (!tmp) return (long) -1;
35997 0 : val = __Pyx_PyInt_As_long(tmp);
35998 0 : Py_DECREF(tmp);
35999 0 : return val;
36000 : }
36001 0 : if (is_unsigned) {
36002 : #if CYTHON_USE_PYLONG_INTERNALS
36003 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
36004 : goto raise_neg_overflow;
36005 : } else if (__Pyx_PyLong_IsCompact(x)) {
36006 : __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
36007 : } else {
36008 : const digit* digits = __Pyx_PyLong_Digits(x);
36009 : assert(__Pyx_PyLong_DigitCount(x) > 1);
36010 : switch (__Pyx_PyLong_DigitCount(x)) {
36011 : case 2:
36012 : if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
36013 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
36014 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36015 : } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
36016 : return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
36017 : }
36018 : }
36019 : break;
36020 : case 3:
36021 : if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
36022 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
36023 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36024 : } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
36025 : return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
36026 : }
36027 : }
36028 : break;
36029 : case 4:
36030 : if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
36031 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
36032 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36033 : } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
36034 : return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
36035 : }
36036 : }
36037 : break;
36038 : }
36039 : }
36040 : #endif
36041 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
36042 : if (unlikely(Py_SIZE(x) < 0)) {
36043 : goto raise_neg_overflow;
36044 : }
36045 : #else
36046 : {
36047 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
36048 : if (unlikely(result < 0))
36049 : return (long) -1;
36050 : if (unlikely(result == 1))
36051 : goto raise_neg_overflow;
36052 : }
36053 : #endif
36054 : if ((sizeof(long) <= sizeof(unsigned long))) {
36055 : __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
36056 : #ifdef HAVE_LONG_LONG
36057 : } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
36058 : __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
36059 : #endif
36060 : }
36061 : } else {
36062 : #if CYTHON_USE_PYLONG_INTERNALS
36063 0 : if (__Pyx_PyLong_IsCompact(x)) {
36064 0 : __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
36065 : } else {
36066 0 : const digit* digits = __Pyx_PyLong_Digits(x);
36067 0 : assert(__Pyx_PyLong_DigitCount(x) > 1);
36068 0 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
36069 : case -2:
36070 0 : if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
36071 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
36072 0 : __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36073 : } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
36074 : return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
36075 : }
36076 : }
36077 : break;
36078 : case 2:
36079 0 : if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
36080 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
36081 0 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36082 : } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
36083 : return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
36084 : }
36085 : }
36086 : break;
36087 : case -3:
36088 : if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
36089 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
36090 : __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36091 : } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
36092 : return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
36093 : }
36094 : }
36095 : break;
36096 : case 3:
36097 : if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
36098 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
36099 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36100 : } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
36101 : return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
36102 : }
36103 : }
36104 : break;
36105 : case -4:
36106 : if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
36107 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
36108 : __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36109 : } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
36110 : return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
36111 : }
36112 : }
36113 : break;
36114 : case 4:
36115 : if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
36116 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
36117 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36118 : } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
36119 : return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
36120 : }
36121 : }
36122 : break;
36123 : }
36124 : }
36125 : #endif
36126 0 : if ((sizeof(long) <= sizeof(long))) {
36127 0 : __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
36128 : #ifdef HAVE_LONG_LONG
36129 : } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
36130 : __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
36131 : #endif
36132 : }
36133 : }
36134 : {
36135 : long val;
36136 : int ret = -1;
36137 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
36138 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
36139 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
36140 : if (unlikely(bytes_copied == -1)) {
36141 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
36142 : goto raise_overflow;
36143 : } else {
36144 : ret = 0;
36145 : }
36146 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
36147 : int one = 1; int is_little = (int)*(unsigned char *)&one;
36148 : unsigned char *bytes = (unsigned char *)&val;
36149 : ret = _PyLong_AsByteArray((PyLongObject *)x,
36150 : bytes, sizeof(val),
36151 : is_little, !is_unsigned);
36152 : #else
36153 : PyObject *v;
36154 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
36155 : int bits, remaining_bits, is_negative = 0;
36156 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
36157 : if (likely(PyLong_CheckExact(x))) {
36158 : v = __Pyx_NewRef(x);
36159 : } else {
36160 : v = PyNumber_Long(x);
36161 : if (unlikely(!v)) return (long) -1;
36162 : assert(PyLong_CheckExact(v));
36163 : }
36164 : {
36165 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
36166 : if (unlikely(result < 0)) {
36167 : Py_DECREF(v);
36168 : return (long) -1;
36169 : }
36170 : is_negative = result == 1;
36171 : }
36172 : if (is_unsigned && unlikely(is_negative)) {
36173 : Py_DECREF(v);
36174 : goto raise_neg_overflow;
36175 : } else if (is_negative) {
36176 : stepval = PyNumber_Invert(v);
36177 : Py_DECREF(v);
36178 : if (unlikely(!stepval))
36179 : return (long) -1;
36180 : } else {
36181 : stepval = v;
36182 : }
36183 : v = NULL;
36184 : val = (long) 0;
36185 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
36186 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
36187 : for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
36188 : PyObject *tmp, *digit;
36189 : long idigit;
36190 : digit = PyNumber_And(stepval, mask);
36191 : if (unlikely(!digit)) goto done;
36192 : idigit = PyLong_AsLong(digit);
36193 : Py_DECREF(digit);
36194 : if (unlikely(idigit < 0)) goto done;
36195 : val |= ((long) idigit) << bits;
36196 : tmp = PyNumber_Rshift(stepval, shift);
36197 : if (unlikely(!tmp)) goto done;
36198 : Py_DECREF(stepval); stepval = tmp;
36199 : }
36200 : Py_DECREF(shift); shift = NULL;
36201 : Py_DECREF(mask); mask = NULL;
36202 : {
36203 : long idigit = PyLong_AsLong(stepval);
36204 : if (unlikely(idigit < 0)) goto done;
36205 : remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
36206 : if (unlikely(idigit >= (1L << remaining_bits)))
36207 : goto raise_overflow;
36208 : val |= ((long) idigit) << bits;
36209 : }
36210 : if (!is_unsigned) {
36211 : if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
36212 : goto raise_overflow;
36213 : if (is_negative)
36214 : val = ~val;
36215 : }
36216 : ret = 0;
36217 : done:
36218 : Py_XDECREF(shift);
36219 : Py_XDECREF(mask);
36220 : Py_XDECREF(stepval);
36221 : #endif
36222 : if (unlikely(ret))
36223 : return (long) -1;
36224 : return val;
36225 : }
36226 : raise_overflow:
36227 : PyErr_SetString(PyExc_OverflowError,
36228 : "value too large to convert to long");
36229 : return (long) -1;
36230 : raise_neg_overflow:
36231 : PyErr_SetString(PyExc_OverflowError,
36232 : "can't convert negative value to long");
36233 : return (long) -1;
36234 : }
36235 :
36236 : /* CIntToPy */
36237 0 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
36238 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
36239 : #pragma GCC diagnostic push
36240 : #pragma GCC diagnostic ignored "-Wconversion"
36241 : #endif
36242 0 : const int neg_one = (int) -1, const_zero = (int) 0;
36243 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
36244 : #pragma GCC diagnostic pop
36245 : #endif
36246 0 : const int is_unsigned = neg_one > const_zero;
36247 0 : if (is_unsigned) {
36248 : if (sizeof(int) < sizeof(long)) {
36249 : return PyInt_FromLong((long) value);
36250 : } else if (sizeof(int) <= sizeof(unsigned long)) {
36251 : return PyLong_FromUnsignedLong((unsigned long) value);
36252 : #ifdef HAVE_LONG_LONG
36253 : } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
36254 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
36255 : #endif
36256 : }
36257 : } else {
36258 0 : if (sizeof(int) <= sizeof(long)) {
36259 0 : return PyInt_FromLong((long) value);
36260 : #ifdef HAVE_LONG_LONG
36261 : } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
36262 : return PyLong_FromLongLong((PY_LONG_LONG) value);
36263 : #endif
36264 : }
36265 : }
36266 : {
36267 : unsigned char *bytes = (unsigned char *)&value;
36268 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
36269 : if (is_unsigned) {
36270 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
36271 : } else {
36272 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
36273 : }
36274 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
36275 : int one = 1; int little = (int)*(unsigned char *)&one;
36276 : return _PyLong_FromByteArray(bytes, sizeof(int),
36277 : little, !is_unsigned);
36278 : #else
36279 : int one = 1; int little = (int)*(unsigned char *)&one;
36280 : PyObject *from_bytes, *result = NULL;
36281 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
36282 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
36283 : if (!from_bytes) return NULL;
36284 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
36285 : if (!py_bytes) goto limited_bad;
36286 : order_str = PyUnicode_FromString(little ? "little" : "big");
36287 : if (!order_str) goto limited_bad;
36288 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
36289 : if (!arg_tuple) goto limited_bad;
36290 : if (!is_unsigned) {
36291 : kwds = PyDict_New();
36292 : if (!kwds) goto limited_bad;
36293 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
36294 : }
36295 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
36296 : limited_bad:
36297 : Py_XDECREF(kwds);
36298 : Py_XDECREF(arg_tuple);
36299 : Py_XDECREF(order_str);
36300 : Py_XDECREF(py_bytes);
36301 : Py_XDECREF(from_bytes);
36302 : return result;
36303 : #endif
36304 : }
36305 : }
36306 :
36307 : /* CIntFromPy */
36308 : static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
36309 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
36310 : #pragma GCC diagnostic push
36311 : #pragma GCC diagnostic ignored "-Wconversion"
36312 : #endif
36313 : const char neg_one = (char) -1, const_zero = (char) 0;
36314 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
36315 : #pragma GCC diagnostic pop
36316 : #endif
36317 : const int is_unsigned = neg_one > const_zero;
36318 : #if PY_MAJOR_VERSION < 3
36319 : if (likely(PyInt_Check(x))) {
36320 : if ((sizeof(char) < sizeof(long))) {
36321 : __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
36322 : } else {
36323 : long val = PyInt_AS_LONG(x);
36324 : if (is_unsigned && unlikely(val < 0)) {
36325 : goto raise_neg_overflow;
36326 : }
36327 : return (char) val;
36328 : }
36329 : }
36330 : #endif
36331 : if (unlikely(!PyLong_Check(x))) {
36332 : char val;
36333 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
36334 : if (!tmp) return (char) -1;
36335 : val = __Pyx_PyInt_As_char(tmp);
36336 : Py_DECREF(tmp);
36337 : return val;
36338 : }
36339 : if (is_unsigned) {
36340 : #if CYTHON_USE_PYLONG_INTERNALS
36341 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
36342 : goto raise_neg_overflow;
36343 : } else if (__Pyx_PyLong_IsCompact(x)) {
36344 : __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
36345 : } else {
36346 : const digit* digits = __Pyx_PyLong_Digits(x);
36347 : assert(__Pyx_PyLong_DigitCount(x) > 1);
36348 : switch (__Pyx_PyLong_DigitCount(x)) {
36349 : case 2:
36350 : if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) {
36351 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
36352 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36353 : } else if ((8 * sizeof(char) >= 2 * PyLong_SHIFT)) {
36354 : return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
36355 : }
36356 : }
36357 : break;
36358 : case 3:
36359 : if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) {
36360 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
36361 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36362 : } else if ((8 * sizeof(char) >= 3 * PyLong_SHIFT)) {
36363 : return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
36364 : }
36365 : }
36366 : break;
36367 : case 4:
36368 : if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) {
36369 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
36370 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36371 : } else if ((8 * sizeof(char) >= 4 * PyLong_SHIFT)) {
36372 : return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
36373 : }
36374 : }
36375 : break;
36376 : }
36377 : }
36378 : #endif
36379 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
36380 : if (unlikely(Py_SIZE(x) < 0)) {
36381 : goto raise_neg_overflow;
36382 : }
36383 : #else
36384 : {
36385 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
36386 : if (unlikely(result < 0))
36387 : return (char) -1;
36388 : if (unlikely(result == 1))
36389 : goto raise_neg_overflow;
36390 : }
36391 : #endif
36392 : if ((sizeof(char) <= sizeof(unsigned long))) {
36393 : __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
36394 : #ifdef HAVE_LONG_LONG
36395 : } else if ((sizeof(char) <= sizeof(unsigned PY_LONG_LONG))) {
36396 : __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
36397 : #endif
36398 : }
36399 : } else {
36400 : #if CYTHON_USE_PYLONG_INTERNALS
36401 : if (__Pyx_PyLong_IsCompact(x)) {
36402 : __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
36403 : } else {
36404 : const digit* digits = __Pyx_PyLong_Digits(x);
36405 : assert(__Pyx_PyLong_DigitCount(x) > 1);
36406 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
36407 : case -2:
36408 : if ((8 * sizeof(char) - 1 > 1 * PyLong_SHIFT)) {
36409 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
36410 : __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36411 : } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
36412 : return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
36413 : }
36414 : }
36415 : break;
36416 : case 2:
36417 : if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) {
36418 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
36419 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36420 : } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
36421 : return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
36422 : }
36423 : }
36424 : break;
36425 : case -3:
36426 : if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
36427 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
36428 : __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36429 : } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
36430 : return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
36431 : }
36432 : }
36433 : break;
36434 : case 3:
36435 : if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) {
36436 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
36437 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36438 : } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
36439 : return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
36440 : }
36441 : }
36442 : break;
36443 : case -4:
36444 : if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
36445 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
36446 : __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36447 : } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
36448 : return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
36449 : }
36450 : }
36451 : break;
36452 : case 4:
36453 : if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) {
36454 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
36455 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36456 : } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
36457 : return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
36458 : }
36459 : }
36460 : break;
36461 : }
36462 : }
36463 : #endif
36464 : if ((sizeof(char) <= sizeof(long))) {
36465 : __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
36466 : #ifdef HAVE_LONG_LONG
36467 : } else if ((sizeof(char) <= sizeof(PY_LONG_LONG))) {
36468 : __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
36469 : #endif
36470 : }
36471 : }
36472 : {
36473 : char val;
36474 : int ret = -1;
36475 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
36476 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
36477 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
36478 : if (unlikely(bytes_copied == -1)) {
36479 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
36480 : goto raise_overflow;
36481 : } else {
36482 : ret = 0;
36483 : }
36484 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
36485 : int one = 1; int is_little = (int)*(unsigned char *)&one;
36486 : unsigned char *bytes = (unsigned char *)&val;
36487 : ret = _PyLong_AsByteArray((PyLongObject *)x,
36488 : bytes, sizeof(val),
36489 : is_little, !is_unsigned);
36490 : #else
36491 : PyObject *v;
36492 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
36493 : int bits, remaining_bits, is_negative = 0;
36494 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
36495 : if (likely(PyLong_CheckExact(x))) {
36496 : v = __Pyx_NewRef(x);
36497 : } else {
36498 : v = PyNumber_Long(x);
36499 : if (unlikely(!v)) return (char) -1;
36500 : assert(PyLong_CheckExact(v));
36501 : }
36502 : {
36503 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
36504 : if (unlikely(result < 0)) {
36505 : Py_DECREF(v);
36506 : return (char) -1;
36507 : }
36508 : is_negative = result == 1;
36509 : }
36510 : if (is_unsigned && unlikely(is_negative)) {
36511 : Py_DECREF(v);
36512 : goto raise_neg_overflow;
36513 : } else if (is_negative) {
36514 : stepval = PyNumber_Invert(v);
36515 : Py_DECREF(v);
36516 : if (unlikely(!stepval))
36517 : return (char) -1;
36518 : } else {
36519 : stepval = v;
36520 : }
36521 : v = NULL;
36522 : val = (char) 0;
36523 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
36524 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
36525 : for (bits = 0; bits < (int) sizeof(char) * 8 - chunk_size; bits += chunk_size) {
36526 : PyObject *tmp, *digit;
36527 : long idigit;
36528 : digit = PyNumber_And(stepval, mask);
36529 : if (unlikely(!digit)) goto done;
36530 : idigit = PyLong_AsLong(digit);
36531 : Py_DECREF(digit);
36532 : if (unlikely(idigit < 0)) goto done;
36533 : val |= ((char) idigit) << bits;
36534 : tmp = PyNumber_Rshift(stepval, shift);
36535 : if (unlikely(!tmp)) goto done;
36536 : Py_DECREF(stepval); stepval = tmp;
36537 : }
36538 : Py_DECREF(shift); shift = NULL;
36539 : Py_DECREF(mask); mask = NULL;
36540 : {
36541 : long idigit = PyLong_AsLong(stepval);
36542 : if (unlikely(idigit < 0)) goto done;
36543 : remaining_bits = ((int) sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1);
36544 : if (unlikely(idigit >= (1L << remaining_bits)))
36545 : goto raise_overflow;
36546 : val |= ((char) idigit) << bits;
36547 : }
36548 : if (!is_unsigned) {
36549 : if (unlikely(val & (((char) 1) << (sizeof(char) * 8 - 1))))
36550 : goto raise_overflow;
36551 : if (is_negative)
36552 : val = ~val;
36553 : }
36554 : ret = 0;
36555 : done:
36556 : Py_XDECREF(shift);
36557 : Py_XDECREF(mask);
36558 : Py_XDECREF(stepval);
36559 : #endif
36560 : if (unlikely(ret))
36561 : return (char) -1;
36562 : return val;
36563 : }
36564 : raise_overflow:
36565 : PyErr_SetString(PyExc_OverflowError,
36566 : "value too large to convert to char");
36567 : return (char) -1;
36568 : raise_neg_overflow:
36569 : PyErr_SetString(PyExc_OverflowError,
36570 : "can't convert negative value to char");
36571 : return (char) -1;
36572 : }
36573 :
36574 : /* FormatTypeName */
36575 : #if CYTHON_COMPILING_IN_LIMITED_API
36576 : static __Pyx_TypeName
36577 : __Pyx_PyType_GetName(PyTypeObject* tp)
36578 : {
36579 : PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
36580 : __pyx_n_s_name_2);
36581 : if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
36582 : PyErr_Clear();
36583 : Py_XDECREF(name);
36584 : name = __Pyx_NewRef(__pyx_n_s__38);
36585 : }
36586 : return name;
36587 : }
36588 : #endif
36589 :
36590 : /* CheckBinaryVersion */
36591 3 : static unsigned long __Pyx_get_runtime_version(void) {
36592 : #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
36593 3 : return Py_Version & ~0xFFUL;
36594 : #else
36595 : const char* rt_version = Py_GetVersion();
36596 : unsigned long version = 0;
36597 : unsigned long factor = 0x01000000UL;
36598 : unsigned int digit = 0;
36599 : int i = 0;
36600 : while (factor) {
36601 : while ('0' <= rt_version[i] && rt_version[i] <= '9') {
36602 : digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
36603 : ++i;
36604 : }
36605 : version += factor * digit;
36606 : if (rt_version[i] != '.')
36607 : break;
36608 : digit = 0;
36609 : factor >>= 8;
36610 : ++i;
36611 : }
36612 : return version;
36613 : #endif
36614 : }
36615 3 : static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
36616 3 : const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
36617 3 : if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
36618 : return 0;
36619 0 : if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
36620 : return 1;
36621 : {
36622 0 : char message[200];
36623 0 : PyOS_snprintf(message, sizeof(message),
36624 : "compile time Python version %d.%d "
36625 : "of module '%.100s' "
36626 : "%s "
36627 : "runtime version %d.%d",
36628 0 : (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
36629 : __Pyx_MODULE_NAME,
36630 : (allow_newer) ? "was newer than" : "does not match",
36631 0 : (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
36632 : );
36633 0 : return PyErr_WarnEx(NULL, message, 1);
36634 : }
36635 : }
36636 :
36637 : /* InitStrings */
36638 : #if PY_MAJOR_VERSION >= 3
36639 624 : static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
36640 624 : if (t.is_unicode | t.is_str) {
36641 621 : if (t.intern) {
36642 447 : *str = PyUnicode_InternFromString(t.s);
36643 174 : } else if (t.encoding) {
36644 0 : *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
36645 : } else {
36646 174 : *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
36647 : }
36648 : } else {
36649 3 : *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
36650 : }
36651 624 : if (!*str)
36652 : return -1;
36653 624 : if (PyObject_Hash(*str) == -1)
36654 : return -1;
36655 : return 0;
36656 : }
36657 : #endif
36658 3 : static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
36659 627 : while (t->p) {
36660 : #if PY_MAJOR_VERSION >= 3
36661 624 : __Pyx_InitString(*t, t->p);
36662 : #else
36663 : if (t->is_unicode) {
36664 : *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
36665 : } else if (t->intern) {
36666 : *t->p = PyString_InternFromString(t->s);
36667 : } else {
36668 : *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
36669 : }
36670 : if (!*t->p)
36671 : return -1;
36672 : if (PyObject_Hash(*t->p) == -1)
36673 : return -1;
36674 : #endif
36675 624 : ++t;
36676 : }
36677 3 : return 0;
36678 : }
36679 :
36680 : #include <string.h>
36681 0 : static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
36682 0 : size_t len = strlen(s);
36683 0 : if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
36684 : PyErr_SetString(PyExc_OverflowError, "byte string is too long");
36685 : return -1;
36686 : }
36687 : return (Py_ssize_t) len;
36688 : }
36689 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
36690 : Py_ssize_t len = __Pyx_ssize_strlen(c_str);
36691 : if (unlikely(len < 0)) return NULL;
36692 : return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
36693 : }
36694 : static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
36695 : Py_ssize_t len = __Pyx_ssize_strlen(c_str);
36696 : if (unlikely(len < 0)) return NULL;
36697 : return PyByteArray_FromStringAndSize(c_str, len);
36698 : }
36699 : static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
36700 : Py_ssize_t ignore;
36701 : return __Pyx_PyObject_AsStringAndSize(o, &ignore);
36702 : }
36703 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
36704 : #if !CYTHON_PEP393_ENABLED
36705 : static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
36706 : char* defenc_c;
36707 : PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
36708 : if (!defenc) return NULL;
36709 : defenc_c = PyBytes_AS_STRING(defenc);
36710 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
36711 : {
36712 : char* end = defenc_c + PyBytes_GET_SIZE(defenc);
36713 : char* c;
36714 : for (c = defenc_c; c < end; c++) {
36715 : if ((unsigned char) (*c) >= 128) {
36716 : PyUnicode_AsASCIIString(o);
36717 : return NULL;
36718 : }
36719 : }
36720 : }
36721 : #endif
36722 : *length = PyBytes_GET_SIZE(defenc);
36723 : return defenc_c;
36724 : }
36725 : #else
36726 : static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
36727 : if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
36728 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
36729 : if (likely(PyUnicode_IS_ASCII(o))) {
36730 : *length = PyUnicode_GET_LENGTH(o);
36731 : return PyUnicode_AsUTF8(o);
36732 : } else {
36733 : PyUnicode_AsASCIIString(o);
36734 : return NULL;
36735 : }
36736 : #else
36737 : return PyUnicode_AsUTF8AndSize(o, length);
36738 : #endif
36739 : }
36740 : #endif
36741 : #endif
36742 : static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
36743 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
36744 : if (
36745 : #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
36746 : __Pyx_sys_getdefaultencoding_not_ascii &&
36747 : #endif
36748 : PyUnicode_Check(o)) {
36749 : return __Pyx_PyUnicode_AsStringAndSize(o, length);
36750 : } else
36751 : #endif
36752 : #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
36753 : if (PyByteArray_Check(o)) {
36754 : *length = PyByteArray_GET_SIZE(o);
36755 : return PyByteArray_AS_STRING(o);
36756 : } else
36757 : #endif
36758 : {
36759 : char* result;
36760 : int r = PyBytes_AsStringAndSize(o, &result, length);
36761 : if (unlikely(r < 0)) {
36762 : return NULL;
36763 : } else {
36764 : return result;
36765 : }
36766 : }
36767 : }
36768 26 : static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
36769 26 : int is_true = x == Py_True;
36770 26 : if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
36771 6 : else return PyObject_IsTrue(x);
36772 : }
36773 : static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
36774 : int retval;
36775 : if (unlikely(!x)) return -1;
36776 : retval = __Pyx_PyObject_IsTrue(x);
36777 : Py_DECREF(x);
36778 : return retval;
36779 : }
36780 0 : static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
36781 0 : __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
36782 : #if PY_MAJOR_VERSION >= 3
36783 0 : if (PyLong_Check(result)) {
36784 0 : if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
36785 : "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
36786 : "The ability to return an instance of a strict subclass of int is deprecated, "
36787 : "and may be removed in a future version of Python.",
36788 : result_type_name)) {
36789 0 : __Pyx_DECREF_TypeName(result_type_name);
36790 0 : Py_DECREF(result);
36791 0 : return NULL;
36792 : }
36793 : __Pyx_DECREF_TypeName(result_type_name);
36794 : return result;
36795 : }
36796 : #endif
36797 0 : PyErr_Format(PyExc_TypeError,
36798 : "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
36799 : type_name, type_name, result_type_name);
36800 0 : __Pyx_DECREF_TypeName(result_type_name);
36801 0 : Py_DECREF(result);
36802 : return NULL;
36803 : }
36804 0 : static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
36805 : #if CYTHON_USE_TYPE_SLOTS
36806 0 : PyNumberMethods *m;
36807 : #endif
36808 0 : const char *name = NULL;
36809 0 : PyObject *res = NULL;
36810 : #if PY_MAJOR_VERSION < 3
36811 : if (likely(PyInt_Check(x) || PyLong_Check(x)))
36812 : #else
36813 0 : if (likely(PyLong_Check(x)))
36814 : #endif
36815 0 : return __Pyx_NewRef(x);
36816 : #if CYTHON_USE_TYPE_SLOTS
36817 0 : m = Py_TYPE(x)->tp_as_number;
36818 : #if PY_MAJOR_VERSION < 3
36819 : if (m && m->nb_int) {
36820 : name = "int";
36821 : res = m->nb_int(x);
36822 : }
36823 : else if (m && m->nb_long) {
36824 : name = "long";
36825 : res = m->nb_long(x);
36826 : }
36827 : #else
36828 0 : if (likely(m && m->nb_int)) {
36829 0 : name = "int";
36830 0 : res = m->nb_int(x);
36831 : }
36832 : #endif
36833 : #else
36834 : if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
36835 : res = PyNumber_Int(x);
36836 : }
36837 : #endif
36838 0 : if (likely(res)) {
36839 : #if PY_MAJOR_VERSION < 3
36840 : if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
36841 : #else
36842 0 : if (unlikely(!PyLong_CheckExact(res))) {
36843 : #endif
36844 0 : return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
36845 : }
36846 : }
36847 0 : else if (!PyErr_Occurred()) {
36848 0 : PyErr_SetString(PyExc_TypeError,
36849 : "an integer is required");
36850 : }
36851 : return res;
36852 : }
36853 6 : static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
36854 6 : Py_ssize_t ival;
36855 6 : PyObject *x;
36856 : #if PY_MAJOR_VERSION < 3
36857 : if (likely(PyInt_CheckExact(b))) {
36858 : if (sizeof(Py_ssize_t) >= sizeof(long))
36859 : return PyInt_AS_LONG(b);
36860 : else
36861 : return PyInt_AsSsize_t(b);
36862 : }
36863 : #endif
36864 6 : if (likely(PyLong_CheckExact(b))) {
36865 : #if CYTHON_USE_PYLONG_INTERNALS
36866 6 : if (likely(__Pyx_PyLong_IsCompact(b))) {
36867 6 : return __Pyx_PyLong_CompactValue(b);
36868 : } else {
36869 0 : const digit* digits = __Pyx_PyLong_Digits(b);
36870 0 : const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
36871 0 : switch (size) {
36872 : case 2:
36873 0 : if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
36874 0 : return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36875 : }
36876 : break;
36877 : case -2:
36878 0 : if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
36879 0 : return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36880 : }
36881 : break;
36882 : case 3:
36883 : if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
36884 : return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36885 : }
36886 : break;
36887 : case -3:
36888 : if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
36889 : return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36890 : }
36891 : break;
36892 : case 4:
36893 : if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
36894 : return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36895 : }
36896 : break;
36897 : case -4:
36898 : if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
36899 : return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36900 : }
36901 : break;
36902 : }
36903 : }
36904 : #endif
36905 0 : return PyLong_AsSsize_t(b);
36906 : }
36907 0 : x = PyNumber_Index(b);
36908 0 : if (!x) return -1;
36909 0 : ival = PyInt_AsSsize_t(x);
36910 0 : Py_DECREF(x);
36911 : return ival;
36912 : }
36913 : static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
36914 : if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
36915 : return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
36916 : #if PY_MAJOR_VERSION < 3
36917 : } else if (likely(PyInt_CheckExact(o))) {
36918 : return PyInt_AS_LONG(o);
36919 : #endif
36920 : } else {
36921 : Py_ssize_t ival;
36922 : PyObject *x;
36923 : x = PyNumber_Index(o);
36924 : if (!x) return -1;
36925 : ival = PyInt_AsLong(x);
36926 : Py_DECREF(x);
36927 : return ival;
36928 : }
36929 : }
36930 0 : static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
36931 0 : return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
36932 : }
36933 : static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
36934 : return PyInt_FromSize_t(ival);
36935 : }
36936 :
36937 :
36938 : /* #### Code section: utility_code_pragmas_end ### */
36939 : #ifdef _MSC_VER
36940 : #pragma warning( pop )
36941 : #endif
36942 :
36943 :
36944 :
36945 : /* #### Code section: end ### */
36946 : #endif /* Py_PYTHON_H */
|